Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


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

[Javascript] value of select


  • From: shawn.milo at gmail.com (Shawn Milo)
  • Subject: [Javascript] value of select
  • Date: Mon Apr 25 08:16:04 2005

It worked for me in FireFox. What browser are you using? I have to go
to a meeting now, but I'll check IE later, and I have Safari at home
if it comes to that.

Shawn

On 4/25/05, Michael Borchers <borchers@xxxxxxxxx> wrote:
> >
> Well, you didn't have the opening <script> tag or a submit button. But
> it worked once I added those.
> 
> <form action="..." method="post" name="orders" onSubmit="return
> orders_submit()">
> <select name="orders_status_id">
>  <option value="">1</option>
>  <option value="1">2</option>
> </select>
> 
> <input type="submit" id="btnSubmit" name="btnSubmit" value="Submit Form" />
> </form>
> 
> <script type="text/javascript">
> function orders_submit()
> {
>        var orders_status_id      =
> document.orders.orders_status_id.options[document.orders.orders_status_id.selectedIndex].value;
> 
>        if (orders_status_id == "1")
>        {
>                alert('test');
>        }
> }
> </script>
> 
> <
> 
> sorry, my mistake when i copied the code,
> of course i had the missing tags in my original script too:)
> but still it won't work:(
> 
> it says:
> document.orders.orders_status_id.options is empty:(
> _______________________________________________
> Javascript mailing list
> Javascript@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 


-- 
Voicemail any time at:
206-666-MILO