You are here: Re: PHP Javascript forms « PHP Programming Language « IT news, forums, messages
Re: PHP Javascript forms

Posted by E-Mo on 10/02/06 19:07

Eric.Thomas.Moore@gmail.com wrote:
> Hey,
>
> My old boss wrote an extensive work tracking system in php for
> internal use. He left and the server he is running it on is very
> outdated so I have been given the task of transfering it over to a new
> server and the latest versions of php, mysql, and apache. That
> information is probably not relevant to the question.
>
> His system has some javascript forms. One of which is a drop down
> menu that uses the onchange functionality. Here is the code:
>
> echo "<FORM NAME=\"changeday\" METHOD=\"post\"
> ACTION=\"workentries.php\">\n";
> echo "<SELECT NAME=\"xselected_date\"
> onchange=\"mySubmit('changeday')\";>\n";
> for($i=0;$i<$past_days;$i++){ // loop through past X days
> echo "<OPTION VALUE='".$dates[$i]."' "; // output option
> if ($dates[$i] == $selected_date) {echo "selected";} // hilight
> currently selected
> echo ">".$months[$i]."/".$days[$i]; // finish option
> } // end of past months loop
> echo "</SELECT>\n"; // end of pull down menu
> echo "<input type=hidden name=xtech value='".$tech."'>"; // keep
> currently selected tech
> echo "</form>\n"; // end of change month form
>
>
> I realize this is messy code, that is why this has been so hard for me.
>
> My problem is the following:
>
> The selected value in the menu is set to $xselected_date. Then upon a
> change the form is submited back to this same php file. At the
> begginning of this php script the code then does:
>
> if (isset($xselected_date)) {blah blah blah}
>
> But this conditional is never evaluating true. Does the select name
> variable not remain declared across the form submit? If not, is there
> a way around this.
>
> Thank you in advance for the help, if i need to provide any more
> information please let me know.
>
> -Eric

 

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

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