Think, this and JS is not really related, or PHP problem.
Problem background: The page to the left is a list of some records, the right is a lot of empty boxes to fill in some information, and then save. Then click on one of the records on the left and the relevant information will appear on the right. I've already implemented all of these features.
Problem: Many empty boxes on the right have one of the Select drop-down list to choose which car. My practice is to read the Carnum (integer type) from the database as the value of option in Select, and the values shown are the Licensenum (license plate number) of the vehicle in the database, which is queried and implemented using the PHP loop method. But when I use JS to specify the value of the Select for that ID, the select does not have a single point of response. I changed this select to a certain select (that is, to remove the PHP loop instead of setting the value and the option name directly in the HTM), then JS can specify the value of the select and display the value.
But I want to be able to cycle through the Select, and JS can specify the value (obviously, so it can be displayed dynamically.) )
How to solve it? Scatter, not enough words to reply or private messages to me, can be another supplement.
Directly on the code:
QAZ123 WSX234 EDC345 TGB456
The following is a select that is implemented in a circular fashion:
Here is the JS section I used:
Daniel, ask for guidance!!!
How to solve this problem? For critical code Snippets or online cases, thank you very much!!!
Reply to discussion (solution)
$(". Lefttask "). Click (function () {
Change into
$(". Lefttask "). Live (" Click ", Function () {...).
The advantage of the latter is the ability to "bind events" even if a DOM node is generated after page loading is complete.
See the jquery Handbook.
$(". Lefttask "). Click (function () {
Change into
$(". Lefttask "). Live (" Click ", Function () {...).
The advantage of the latter is the ability to "bind events" even if a DOM node is generated after page loading is complete.
See the jquery Handbook.
Wow, you're here, welcome. Try it immediately.
Thanks, man.
Another better way is to use the onclick= "xxxxxxxx ()" in dynamically generated HTML tags, which is not as expensive as live browser resources
$(". Lefttask "). Click (function () {
Change into
$(". Lefttask "). Live (" Click ", Function () {...).
The advantage of the latter is the ability to "bind events" even if a DOM node is generated after page loading is complete.
See the jquery Handbook.
Error message:
line:408
Error:object doesn ' t support property or method ' Live '
Maybe it's the version problem I set up in the head.
The first two days you gave me a checkbox in the attr also made a mistake, and finally replaced with the latest version of prop, only to finally succeed.
There's a space in the middle!
QAZ123
Become a
QAZ123
It's no problem, it's weird.
There's a space in the middle!
QAZ123
Become a
QAZ123
It's no problem, it's weird.
Moderator wise, just I checked for a long time, but also found this problem.
In this way, the moderator pointed out the problem, and then look at my consistent support.
Knot stickers, two people are acquaintances, you see this can be:
Moderator 65 points, another look at me 35 points how?
In this way, the moderator pointed out the problem, and then look at my consistent support.
Knot stickers, two people are acquaintances, you see this can be:
Moderator 65 points, another look at me 35 points how?
Are all acquaintances, for the moment. Have to feel dissatisfied, can reply or private messages to me.
Thank you again and again for your help!!!
The scores are floating clouds, it doesn't matter .... Have problems continue to communicate .... Version of the big really sharp a look at the problem