You are here: Re: php textbox GET values become unchangeable « All PHP « IT news, forums, messages
Re: php textbox GET values become unchangeable

Posted by mens libertina on 10/10/69 11:50

edfialk@gmail.com wrote:
> some example code:
>
> $mapTime = $_GET["mapTime"];
> if (isset($mapTime))
> echo "document.form1.mapTime.value= '".$mapTime."';\n";
>
> Map Time: <input type="text" name="mapTime" value="2006-03-01">


I'm not sure what you wrote here, whether you are showing 5 lines of
your PHP script or if you are showing 4 lines of the PHP and the
result. But by setting the value to "2006-03-01", you are locking in
that value so it can't change. I think what you probably want to do in
your PHP script is something like:

$mapTime = $_GET["mapTime"]; // Grab the user's input

if ( !isset($mapTime) ) // User didn't enter anything
$mapTime = <default value>; // So set $mapTime to a
default value

echo "document.form1.mapTime.value= '".$mapTime."';\n"; //Will
either be the user's last input, or your default

I hope this helps.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация