PDA

View Full Version : Trying to add to Drop-down Document Viewer



01101011k
09-26-2005, 09:36 PM
Wow, maybe if I had realized this forum was here I could have gotten this done sooner...

Drop-down Document Viewer
http://www.dynamicdrive.com/dynamicindex3/dropdownview.htm

K... Dont know if you can help because it not a problem with the script directly but something I want it to do. I was trying to get it to where there was another option so the you could type in another page that wasnt listed

I tried to stick in pieces to another code so the beginning so that it looked like this:


<form name="jumpy">

<INPUT TYPE="RADIO" NAME="listed" onclick="no();" CHECKED>Listed

<select name="example" size="1" onChange="gone()">
<!-- CHANGE THE BELOW URLS TO YOUR OWN-->
<option value="http://www.yahoo.com" selected>Yahoo.com</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.lycos.com">Lycos</option>
<option value="http://www.AltaVista.com">AltaVista</option>
<BR>
<BR>
<INPUT TYPE="RADIO" NAME="other" onclick="yes();">Other

<BR>
<DIV ID="MMDiv" style="visibility:hidden">
<LABEL FOR="MakeModel">
<INPUT TYPE="TEXT" name="example" ID="MakeModel">
Or, Enter your own using format http://www.mysite.com</LABEL>
</DIV>
<BR>

</select>
</form>
<input type="button" name="test" value="Go!" onClick="gone()">
<BR>
<BR>

But I keep getting this error: "'document.jumpy.example.options' is null or not an object" Any one got any ideas? Or maybe you could add another verision of the code that does that :D

Thanks

jscheuer1
09-27-2005, 02:17 AM
The problem is that you have two form elements named 'example'. That is fine for some purposes but, when accessing them via the forms collection using javascript, there can be only one. Otherwise the script cannot know which to choose. Something else wrong but not involved in this problem is that you have other form elements inside of the the select element. It should only contain its options, nothing else.