Hey
I was wondering how would i get like an id value so i could do something like this:
I have 2 fields and a div (status).
Thats 2 sets of field and there would be alot more! coded with PHP (foreach item).HTML Code:<input name="item_1" type="hidden" value="1" /> <input type="text" name="date_1" id="dateselect" onchange="check();" /> <div id="status_1">Click on the field above!</div> <input name="item_2" type="hidden" value="2" /> <input type="text" name="date_2" id="dateselect" onchange="check();" /> <div id="status_2">Click on the field above!</div>
So i need to pass the values of these fields into a ajax request.
How would i get the "1" or "2" as a var called id, so i could do something likeHTML Code:date = $("[name='date']").val(); item = $("[name='item']").val(); elm = "#status";
Since there will be multiple of these mini checkers, doing the same but not at the same time, only when clicked. I can easily do it when there is only 1 but when there is like more then 1 im a little stuck.HTML Code:date = $("[name='date_"+id+"']").val(); item = $("[name='item_"+id+"']").val(); or item = id; elm = "#status_"+id;
Thanks for any help



Reply With Quote
Bookmarks