Forum Moderators: open

Message Too Old, No Replies

JavaScript Pop up from select drop down

Pop up window to appear on selecting one item only

         

woldie

10:05 am on Apr 26, 2004 (gmt 0)

10+ Year Member



Hello,

I've got this drop down select box, and when you select 'other' only I want pop up window to appear.

If you select anything else then it should do nothing.

Has anyone come across this before if so, can you point me in the right direction?

<select name=purpose size=1 class="property">
<option value="null">Select One</option>
<option value="Replace existing borrowing">Replace existing borrowing</option>
<option value="Home Improvements">Home Improvements</option>
<option value="Purchase Car">Purchase Car</option>
<option value="Go on Holiday">Go on Holiday</option>
<option value="Other">Other</option>
</select>

Thanks

BlobFisk

8:20 am on Apr 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi woldie,

This can be done by using onChange to run a function that checks to see the value of the selectedIndex, and if that value is the one you want the popup to open on, it then opens the window (using window.open).

I'd be cautious of using an event like this to open a new window, you are running the risk of annoying a lot of users...

HTH