sureshraina
asked on
onchange redirect
I have a <select id=aid >
<option=1>US</option>
<option=2>UK</option>
</select> element in my abs.aspx page.
I want to redirect the user onchange of selectbox to the same page and pass a parameter cid which will be the selected value.
i.e if user selects UK it should redirect to abs.aspx?cid=2
Pls help
<option=1>US</option>
<option=2>UK</option>
</select> element in my abs.aspx page.
I want to redirect the user onchange of selectbox to the same page and pass a parameter cid which will be the selected value.
i.e if user selects UK it should redirect to abs.aspx?cid=2
Pls help
ASKER
thanks.
But this is opening in a new window. I want in the same window..
thanks again
But this is opening in a new window. I want in the same window..
thanks again
ok, change the line with window.location.href to:
parent.window.location.hre f = 'http://example.com/foo.aspx?cid=' + obj.options[obj.selectedIn dex].value ;
parent.window.location.hre
ASKER
It is still opening in new window after changing.
I cannot submit the form as i am doing other things on submit
I cannot submit the form as i am doing other things on submit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This might work as well. Replace 'ddlName' with the name of your Drop Down List control.
Response.Write("<script>wi ndow.open( abs.aspx?c id=" & ddlName.SelectedValue & "');</script>")
Response.Write("<script>wi
just curious, any particular reason for a grade B?
<script>
function cboChange(obj)
{
window.location.href = 'http://example.com/foo.aspx?cid=' + obj.options[obj.selectedIn
}
</script>
<select id="aid" onchange="cboChange(this);
<option value="1">US</option>
<option value="2">UK</option>
</select>