hwg-techniques archives | Nov 2000 | new search | results | previous | next |
Re: javascript and drop down formby Steve <sdeemer(at)yahoo.com> |
|
I am not sure what you are trying to pass but if I look at your code here you are simply going to no value in the url... Why not keep it simple... Using the selectedindex below will change the url ref onchange.. Is this what you are trying to do? <form> <select name="MainSilos" onChange="window.location.href=this.form.MainSilos.options[this.form.MainSilos.selectedIndex].value"> <option value="" selected>--</option> <option value="http://www.music.com">Music</option> <option value="http://www.culture.com">Culture</option> <option value="http://www.politics.com">Politics</option> </select> </form> Regards Steve --- Kenny Lai <klai(at)rs1winc.com> wrote: > hey all, > i'm trying to pass the option values of the drop > down form element > using the onChange event, however, havent a little > trouble doing so. > can anyone shed some light? here's what i have so > far: > > <SCRIPT LANGUAGE="JavaScript"> > <!-- dropdown submit for Mainsilos > function formHandler(){ > var URL = document.MainSilos; > window.location.href = URL; > // End --> > } > </SCRIPT> > > <select name="MainSilos" onChange="formHandler()"> > <option value="" selected>--</option> > <option value="1">Music</option> > <option value="2">Culture</option> > <option value="3">Politics</option> > </select> > > ===== www.pc-wizard.net Mr.Wizard(at)pc-wizard.net =============================================== ______ _______ _______ __ __ _______ | | | | | | |____ | |____ | | |____ | | | | | | _____| | |______ || |______ __________________________________________________ Do You Yahoo!? Yahoo! Calendar - Get organized for the holidays! http://calendar.yahoo.com/
HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA