xox Posted January 6, 2011 Share Posted January 6, 2011 For example, I've got 10 input boxes (textbox) and 5 of them must contain date that user enters using calender script, the problem is, all of the boxes that requires date as input have the same id and now only first textbox is populated (logic I know), how can I populate the other ones? Code for showing calendar images next to textboxes which IDs are "a": if ($row['fieldtype'] == 'a') { echo '<input type="text" id="a" name="textbox[]" value=""></td><td>'; echo '<input type="hidden" id="a" name="textbox[]" value=""></td><td>'; echo '<a href="javascript:viewcalendar()"><img src="calendar.png"></a></td><td>'; } And the code in scripts.js that populates fields function insertdate(d) { window.close(); window.opener.document.getElementById('a').value = d; } Link to comment https://forums.phpfreaks.com/topic/223592-multiple-textbox-value-change-date/ Share on other sites More sharing options...
xox Posted January 6, 2011 Author Share Posted January 6, 2011 I've forgot to write that fields are generated depending on number of values in DB, it could show low as 1 field and up to 40 fields. And there can be none date required field or unlimited. Link to comment https://forums.phpfreaks.com/topic/223592-multiple-textbox-value-change-date/#findComment-1155826 Share on other sites More sharing options...
xox Posted January 8, 2011 Author Share Posted January 8, 2011 No one? Link to comment https://forums.phpfreaks.com/topic/223592-multiple-textbox-value-change-date/#findComment-1156836 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.