Jump to content

Multiple textbox value change (date)


xox

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.