Results 1 to 2 of 2

Thread: Trying to add to Drop-down Document Viewer

  1. #1
    Join Date
    Sep 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Trying to add to Drop-down Document Viewer

    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/dynamici...opdownview.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:

    Code:
    <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

    Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •