Re: questions regarding PHP and Forms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I missed the start of the thread but it may be because you have a space in
"rowing machine" for the option.

Try "rowing_machine" or "rowingmachine" and see what happens.

(check your javascript console - in firefox type 'javascript:' in the
address bar without the quotes).

On 1/29/06, Miles Thompson <miles@xxxxxxxxxxxxxxxxx> wrote:
>
> At 05:39 PM 1/28/2006, Paul Goepfert wrote:
>
> >Thanks for the help everyone.  I have decided to use javascript to
> >deal with my second problem.  I understand that this is not a
> >JavaScript fourm but I am having some trouble getting my JS function
> >to work correctly.
> >
> >Here is my JS code.
> >
> >function getEquipment ()
> >{
> >         var mylist = document.getElementById("equip");
> >         if (mylist.options[mylist.selectedIndex].value=="other")
> >         {
> >                 document.writeln("<tr>");
> >                 document.writeln("      <td align="left">Other</td>");
> >                 document.writeln("      <td><input type="text"
> > name="other" size="20"></td>");
> >                 document.writeln("</tr>");
> >         }
> >}
> >
> >This is my code for where the function is called
> >
> ><select name="equipment" size="1" id="equip" onChange="getEquipment()">
> >                             <option value="treadmill">Treadmil</option>
> >                             <option value="exercise bike">Exercise
> > Bike</option>
> >                             <option value="other">Other</option>
> >                             <option value="rowing machine"
> >selected>Rowing Machine</option>
> >                           </select>
> >
> >My problem is when the page loads in a web browser the Option "Other"
> >is selected every time. From what you can see from my code   "Rowing
> >machine is the one that I want to be shown when the page loads.
> >
> >Anyway can anyonne tell me why my code is not executing correctly.  I
> >am not too familiar with java script.  What I am trying to accomplish
> >is if Other is selected then add a new table row below the drop down
> >menu with the content that I have in the function.
> >
> >If no one can help with this would someone please direct me to a Java
> >Script  Forum.
> >
> >Thanks
> >
> >Paul
>
> Javascript@xxxxxxxxxx
>
> Registration is required.
>
> MT
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux