Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: [Javascript] value of select
- From: borchers at tridem.de (Michael Borchers)
- Subject: AW: [Javascript] value of select
- Date: Mon Apr 25 08:08:33 2005
>
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:(
- Follow-Ups:
- [Javascript] value of select
- From: Shawn Milo
- [Javascript] value of select
- From: Flavio Gomes
- [Javascript] value of select
- Prev by Date: [Javascript] value of select
- Next by Date: [Javascript] value of select
- Previous by thread: [Javascript] value of select
- Next by thread: [Javascript] value of select
- Index(es):