Jump to content

Archived

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

somo

Need to get input field contents...

Recommended Posts

Hi,

does anybody know how i can get the contents of an input field?  I need a date entered by a user that i then need to use in a script on the same page.

im don't know how i can go around doin it

thanks.  :)

Share this post


Link to post
Share on other sites
when you sat date you mean the date the user post the form if so i got this ok.

$date=date("y/m/d"); year month day.

for debuging purpose the date will be shown in the input box you can easly put hidden ok.

<input type="text" name="date" value=<?echo $date; ?>">

Share this post


Link to post
Share on other sites
No i have a mini calendar that gets the user to select a date which is autoimatically put into a field.

All i need to do is get the field contents e.g. 09 July 2006  and store this as a variable in php sp i can use that variabile in an amount of days calculation script.

[quote author=redarrow link=topic=99953.msg393922#msg393922 date=1152448832]
when you sat date you mean the date the user post the form if so i got this ok.

$date=date("y/m/d"); year month day.

for debuging purpose the date will be shown in the input box you can easly put hidden ok.

<input type="text" name="date" value=<?echo $date; ?>">
[/quote]

Share this post


Link to post
Share on other sites
example form:
[code]
<form action = 'blah.php' method='post'>
  <input type = 'text' name = 'somefield'>
  <input type = 'submit' value='blah'>
</form>
[/code]
and then in blah.php you would get the info like so:
[code]
//example
echo $_POST['somefield']; //echos out what you put in the 'somefield' input field
[/code]

Share this post


Link to post
Share on other sites

×

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.