pbalsamo Posted October 6, 2008 Share Posted October 6, 2008 Cant someone help with code below on how I can put 2 dates in two textfields with code below. the fields are named Datefrom and Dateto thanks <?php $country=$_REQUEST['SelectDate']; switch($country) { case "1" : Datefrom textfield = Datefrom; Dateto; textfield = Dateto; break; case "2" : Datefrom textfield = Datefrom; Dateto; textfield = Dateto; break; } ?> <form action="" name="form3" id="form3"> <select name="SelectDate" id="SelectDate" onchange=""> <option value="1">Current Year</option> <option value="2">Current Year-to-date</option> <option value="3">Yesterday</option> <option value="4">Last Week</option> <option value="5">Last Week-to-date</option> <option value="6">Last Month</option> <option value="7">Last Month-to-date</option> <option value="8">Last Year</option> <option value="9">Last Year-to-date</option> <option value="10">Today</option> <option value="11">Current Month</option> <option value="12">Current Quarter</option> <option value="13">Current Quarter-to-date</option> <option value="14">All Dates</option> </select> from <input name="Datefrom" type="text" id="Datefrom" value="<?php echo date("Y-01-01"); ?>" size="10" /> to <input name="Dateto" type="text" id="Dateto" value="<?php echo date("Y-12-31"); ?>" size="10" /> <input name="Datenow" type="hidden" id="Datenow" value="<?php echo date("Y-m-d"); ?>" size="10"/> <input type="submit" name="button2" id="button2" value="New date" /> </form> Link to comment https://forums.phpfreaks.com/topic/127250-textfield-help/ Share on other sites More sharing options...
JonnoTheDev Posted October 6, 2008 Share Posted October 6, 2008 Wouldnt use a textfield for date input. You will end up with malformed dates if the user changes the values. Use 3 fields day, month, year. Better as select elements. Link to comment https://forums.phpfreaks.com/topic/127250-textfield-help/#findComment-658175 Share on other sites More sharing options...
pbalsamo Posted October 7, 2008 Author Share Posted October 7, 2008 I wanted to have the textedit fields change to the date field through the list/menu I need to know how to do this thanks Link to comment https://forums.phpfreaks.com/topic/127250-textfield-help/#findComment-658642 Share on other sites More sharing options...
trq Posted October 7, 2008 Share Posted October 7, 2008 What exactly is your question / problem? Link to comment https://forums.phpfreaks.com/topic/127250-textfield-help/#findComment-658644 Share on other sites More sharing options...
pbalsamo Posted October 7, 2008 Author Share Posted October 7, 2008 I want to click list/menu that has certain dates in it. And have those date put into (2) textedit fields, the problem is I dont know how to code the case statement to populate the text fields thanks Link to comment https://forums.phpfreaks.com/topic/127250-textfield-help/#findComment-659029 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.