Catch Index number of form element array
I want to get index number of form element array. where I want to put name in the front of code input box. Can any body tell me that how is possible.
My code is as follow:
and JS FILE is
echo "<form name="region">";
echo '<input type="text" name="code" onkeyDown="check(this)">
echo '<input type="text" name="name" >
I tried to use this code but it does not work
What exactly are you trying to do? Though I suspect that using k.value instead of k.index is the solution you're looking for.
Actually I need the index Number of k which I want to use for the next column like name
Hope you will be understand
There is no property of a form element that indicates its order in the DOM. Since such a value isn't readily available, you'll have to calculate it for each element, which can be an expensive operation. Your alternative to that would be to cache the initial calculation and reference it later, reducing your iterations (but not the processing time of the initial).
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)