[Javascript] value of select
Shawn Milo
shawn.milo at gmail.com
Mon Apr 25 08:15:53 CDT 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 at tridem.de> 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 at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
--
Voicemail any time at:
206-666-MILO
More information about the Javascript
mailing list