|
-
Jan 29th, 2003, 09:21 AM
#1
Thread Starter
Fanatic Member
Script run on combo
I have a combo with 4 items on a form "form1".
When the user choses the 4th item "item4" I want to trigger a messagebox and when the message box is closed I want to redirect the user to a different page.
I wish to do this without the user submitting the form.
Can anyone point me in the right direction. I no naff all about client side work (another thing to add to my To Do list).
Thanks in Advance
-
Jan 31st, 2003, 09:06 AM
#2
Addicted Member
I did something similar:
<select class="quickl_homepage" onchange="goTo(this)">
<option value="">Bank</option>
<option value="">-------------------------------</option>
<option value="sc.asp">a</option>
<option value="lca.asp">b</option>
<option value="Eur.asp">c</option>
<option value="Eur2.asp">d</option>
</select>
and the javascript function:
<script>
function goTo(srcEl)
{
var temp
temp = srcEl.options[srcEl.selectedIndex].value;
srcEl.selectedIndex = 0;
if (temp!='')
{
window.location.href = temp;
}
}
</script>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|