Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.