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 <[EMAIL PROTECTED]> 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
>
> [EMAIL PROTECTED]
>
> Registration is required.
>
> MT
>

Reply via email to