miniu Posted April 3, 2010 Share Posted April 3, 2010 I have a table where you can put the dates, but i want to make also a button that says "clear date" that will clear the date. How can I make that? this is the code for the dates: <tr> <td colspan="2" align="right"><font color="red"></font> From Date: </td> <td width="25%"><font color="<?=$col?>"> <input type="text" name="txtfromdate" readonly="true" id="txtfromdate" size="15" value="<?=stripslashes($fromdate);?>"> <a href="#" onClick="getCalendar(document.getElementById('txtfromdate'));">Select Date</a></font></td> <td width="8%"> To Date:</td> <td width="51%"><font color="<?=$col?>"> <input type="text" name="txttodate" readonly="true" id="txttodate" size="15" value="<?=stripslashes($todate);?>"> <a href="#" onClick="getCalendar(document.getElementById('txttodate'));">Select Date</a></font></td> </tr> Link to comment https://forums.phpfreaks.com/topic/197474-erase-date/ Share on other sites More sharing options...
GetPutDelete Posted April 3, 2010 Share Posted April 3, 2010 Erm... If you want to erase the contents of a div use document.getElementById('DIV NAME') = ''; Sorry if that's not what you wanted. Link to comment https://forums.phpfreaks.com/topic/197474-erase-date/#findComment-1036478 Share on other sites More sharing options...
ignace Posted April 3, 2010 Share Posted April 3, 2010 document.getElementById("txtfromdate").setAttribute("value", ""); Link to comment https://forums.phpfreaks.com/topic/197474-erase-date/#findComment-1036530 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.