Computing.Net > Forums > Programming > javascript select form help

javascript select form help

Reply to Message Icon

Original Message
Name: Cruel_Love
Date: October 28, 2003 at 17:04:30 Pacific
Subject: javascript select form help
OS: windows me
CPU/Ram: don't know
Comment:

i want only one select window [the drop down menus] but for different options to open in different areas [new, in an iframe, etc]

so i thought i'd try this for an image.

and in the body:
<FORM NAME="form1">
<SELECT NAME="link" onChange="artto(this.form)" class="px9black" style="width: 155px">
<option selected>art / photo</option>
<option value="javascript:displayWindow('a1.jpg',270,240)">hush</option>
</select>
</form>

only it doesn't work. is there a way of doing this without having multiple select windows? - one for each area i want.


Report Offensive Message For Removal

Response Number 1
Name: Cruel_Love
Date: October 28, 2003 at 17:38:05 Pacific
Subject: javascript select form help
Reply: (edit)

here's a link for it:

http://artlist.united.net.kg/selectform.html

it won't let me post the script for the header.


Report Offensive Follow Up For Removal

Response Number 2
Name: SN
Date: October 28, 2003 at 21:28:57 Pacific
Subject: javascript select form help
Reply: (edit)

It may just be me...I seem to be having difficulty understanding people's questions today. But I don't really get what you're trying to do. I assume you mean that you have one drop down list, and depending on the selected value, you may want an image to appear in a new window, in a different frame, or whatever.

If this is the case, then you need to define a function that finds out the value of the menu and does the appropriate action. Then you would make this function run "onChange" (as you have it above)

In other words, don't have the javascript in the OPTION tags...Just have a function figure out what the value is and do the appropriate action.

I won't actually write any example code unless I get some confirmation that this is what you want to do. Feel free to post back with any clarifications.


Report Offensive Follow Up For Removal

Response Number 3
Name: Cruel_Love
Date: October 29, 2003 at 10:53:47 Pacific
Subject: javascript select form help
Reply: (edit)

yes i want it to appear in a new window, which i can do. the problem is i want the window to be resized depending on the option selected hence the display window function i have. but if i do it in the main script it would be set the same size for all the options and if i do it in the options [call the javascript which you said i can't] it doesn't work...


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: javascript select form help

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software