Just Can't Open Drop Downs in Same Window

Discussion in 'Javascript' started by Kim14, Feb 1, 2005.

  1. Kim14

    Kim14 Guest

    Help!

    I am trying to create a webpage and it would be obvious to anyone who
    reads my source code (it's a mess) that I created it using a template.
    I know almost nothing about webpages, but am happy with all but a few
    bugs in my page.

    I have read many posts about opening drop-downs in new windows, and
    have spent hours looking over my source code to see what I have done
    wrong.

    My links open in the same window like I want, but ALL of my drop-downs
    open in a new window!

    Can someone please have mercy on me and help???
    Thanks for any advice you can give.

    Kim
    Kim14, Feb 1, 2005
    #1
    1. Advertising

  2. Kim14

    RobB Guest

    Kim14 wrote:
    > Help!
    >
    > I am trying to create a webpage and it would be obvious to anyone who
    > reads my source code...


    (snip)

    No danger of that.

    > I have spent hours looking over my source code to see what I have

    done
    > wrong.


    (snip)
    No one out here will spend 'hours', but 'minutes' might work wonders.
    RobB, Feb 1, 2005
    #2
    1. Advertising

  3. Kim14

    Kim14 Guest

    Sorry, didn't mean to offend you... just thought this was a place where
    someone might offer some help to a newcomer just starting out-
    apparently I knocked on the wrong door.
    Kim14, Feb 1, 2005
    #3
  4. Kim14

    RobB Guest

    Kim14 wrote:
    > Sorry, didn't mean to offend you... just thought this was a place

    where
    > someone might offer some help to a newcomer just starting out-
    > apparently I knocked on the wrong door.


    Not offended at all ! If you were reading your post, instead of writing
    it, how would you 'offer some help' in fixing coding you couldn't see?

    A bit like diagnosing car trouble over the phone. Post the HTML for
    those selects & any JavaScript called (presumably onchange) by them.
    RobB, Feb 1, 2005
    #4
  5. Kim14

    Kim14 Guest

    Not sure if this is the part of the code needed, but I am trying...



    <HEAD><meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">

    <script>
    <!--
    function land(ref, target)
    {
    lowtarget=target.toLowerCase();
    if (lowtarget=="_self") {window.location=loc;}
    else {if (lowtarget=="_top") {top.location=loc;}
    else {if (lowtarget=="_blank") {window.open(loc);}
    else {if (lowtarget=="_parent") {parent.location=loc;}
    else {parent.frames[target].location=loc;};
    }}}
    }
    function jump(menu)
    {
    ref=menu.choice.options[menu.choice.selectedIndex].value;
    splitc=ref.lastIndexOf("*");
    target="";
    if (splitc!=-1)
    {loc=ref.substring(0,splitc);
    target=ref.substring(splitc+1,1000);}
    else {loc=ref; target="_self";};
    if (ref != "") {land(loc,target);}
    }
    //-->
    </script>


    ------
    <tr>
    <td>
    <div align="center"></div><font face="tahoma" size="2"><font
    color="#ccff00"><div align="center">Dowloadable
    Forms</div></font></font></a>
    </div>
    <div align="center">
    <form action="dummy" method="post"><select name="choice" size="1"
    onChange="jump(this.form)"><option
    value="http://www.idph.state.ia.us/common/pdf/vital_records/application_certified_copy_vital_record.pdf">Birth/Death/Marriage
    Request</option>
    <option value="marriage_app.pdf">Marriage Application</option><option
    value="http://travel.state.gov/pdf/DS-0011.pdf">Passport
    Application</option><option
    value="http://www.archives.gov/research_room/obtain_copies/standard_form_180.pdf">Veteran's
    Record Request Form</option><option value="dov.pdf">Declaration of
    Value- must use 8 1/2" x 14 paper</option>
    <option value="ground.pdf">Groundwater Hazard
    Statement</option></select></form>
    </div>
    </td>
    </tr>
    Kim14, Feb 1, 2005
    #5
  6. Kim14

    RobB Guest

    Kim14 wrote:
    > Not sure if this is the part of the code needed, but I am trying...
    >
    >
    >
    > <HEAD><meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1">
    >
    > <script>
    > <!--
    > function land(ref, target)
    > {
    > lowtarget=target.toLowerCase();
    > if (lowtarget=="_self") {window.location=loc;}
    > else {if (lowtarget=="_top") {top.location=loc;}
    > else {if (lowtarget=="_blank") {window.open(loc);}
    > else {if (lowtarget=="_parent") {parent.location=loc;}
    > else {parent.frames[target].location=loc;};
    > }}}
    > }
    > function jump(menu)
    > {
    > ref=menu.choice.options[menu.choice.selectedIndex].value;
    > splitc=ref.lastIndexOf("*");
    > target="";
    > if (splitc!=-1)
    > {loc=ref.substring(0,splitc);
    > target=ref.substring(splitc+1,1000);}
    > else {loc=ref; target="_self";};
    > if (ref != "") {land(loc,target);}
    > }
    > //-->
    > </script>
    >
    >
    > ------
    > <tr>
    > <td>
    > <div align="center"></div><font face="tahoma" size="2"><font
    > color="#ccff00"><div align="center">Dowloadable
    > Forms</div></font></font></a>
    > </div>
    > <div align="center">
    > <form action="dummy" method="post"><select name="choice" size="1"
    > onChange="jump(this.form)"><option
    >

    value="http://www.idph.state.ia.us/common/pdf/vital_records/application_certified_copy_vital_record.pdf">Birth/Death/Marriage
    > Request</option>
    > <option value="marriage_app.pdf">Marriage Application</option><option
    > value="http://travel.state.gov/pdf/DS-0011.pdf">Passport
    > Application</option><option
    >

    value="http://www.archives.gov/research_room/obtain_copies/standard_form_180.pdf">Veteran's
    > Record Request Form</option><option value="dov.pdf">Declaration of
    > Value- must use 8 1/2" x 14 paper</option>
    > <option value="ground.pdf">Groundwater Hazard
    > Statement</option></select></form>
    > </div>
    > </td>
    > </tr>


    You're not doing anything wrong - it's those .pdf files that are
    causing the problem (try this in another browser - like Mozilla Firefox
    - to see). Found this:

    http://support.microsoft.com/?kbid=305836

    ....which might be related. Not sure of the fix, if there is one. I'll
    toss this one back in the air /:eek:)

    Sorry I couldn't have been more helpful.
    http://www.mozilla.org/products/firefox/
    RobB, Feb 1, 2005
    #6
  7. Kim14

    Kim14 Guest

    RobB-

    Thank you so much for your efforts! I read the microsoft support page
    and it sure sounds like my problem, as all my other links work fine on
    opening. I have been working on this page in IE and Mozilla and get
    the same results. It just gives me some relief to think I'm not just
    losing my mind- I will now stop beating my head against the wall on
    this issue.

    Like I said, I can't thank you enough for your help!!!
    Kim14, Feb 1, 2005
    #7
  8. Kim14

    Kim14 Guest

    Just came up with another interesting problem. My first drop-down list
    contains pdf files, but my 3rd drop-down contains URL's. The URL's
    also open in their own page.

    All of my drop-downs are on the same page, so the head of my document
    would be the same as my earlier post. Here are the specifics on the
    drop-down with URL's.

    If this is the case, maybe the earlier conclusion was not my problem?

    <tr>
    <td>
    <div align="center"></div><font face="tahoma" size="2"><font
    color="#ccff00"><div align="center">Realtors</div></font></font></a>
    </div>
    <div align="center"><form action="dummy" method="post"><select
    name="choice" size="1" onChange="jump(this.form)"><option
    value="http://www.abensrealty.com">Abens Realty</option><option
    value="http://www.rodandtrudy.com">Farmers National
    Company</option><option value="">J/C Wells Real
    Estate</option><option value="http://jimfortunerealty.com/">Jim Fortune
    Realty</option><option value="http://www.kingrealtywc.com/">King
    Realty</option><option
    value="http://www.webstercityrealestate.com/">Webster City Real
    Estate</option></select></form>
    </td>
    </tr>
    </tr>
    Kim14, Feb 1, 2005
    #8
  9. Kim14

    RobB Guest

    Kim14 wrote:
    > Just came up with another interesting problem. My first drop-down

    list
    > contains pdf files, but my 3rd drop-down contains URL's. The URL's
    > also open in their own page.
    >
    > All of my drop-downs are on the same page, so the head of my document
    > would be the same as my earlier post. Here are the specifics on the
    > drop-down with URL's.
    >
    > If this is the case, maybe the earlier conclusion was not my problem?
    >
    > <tr>
    > <td>
    > <div align="center"></div><font face="tahoma" size="2"><font
    > color="#ccff00"><div align="center">Realtors</div></font></font></a>
    > </div>
    > <div align="center"><form action="dummy" method="post"><select
    > name="choice" size="1" onChange="jump(this.form)"><option
    > value="http://www.abensrealty.com">Abens Realty</option><option
    > value="http://www.rodandtrudy.com">Farmers National
    > Company</option><option value="">J/C Wells Real
    > Estate</option><option value="http://jimfortunerealty.com/">Jim

    Fortune
    > Realty</option><option value="http://www.kingrealtywc.com/">King
    > Realty</option><option
    > value="http://www.webstercityrealestate.com/">Webster City Real
    > Estate</option></select></form>
    > </td>
    > </tr>
    > </tr>


    Sorry for the delay. Couldn't reproduce your problem; does seem to be a
    ..pdf related issue. Setting the Location object (window.location) to a
    new url is pretty basic browser programming. btw if you're not
    targeting any of those urls to anything but the same, non-framed
    window, you don't need all that rigmarole:

    function jump(obj, url)
    {
    if (obj &&
    (url = obj.options[obj.selectedIndex].value))
    top.location = url;
    }

    ....and:

    <select name="choice" size="1" onchange="jump(this)">
    ....should do the trick.
    RobB, Feb 2, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davmagic .Com

    Need Script For Drop Downs

    Davmagic .Com, Oct 14, 2004, in forum: Perl
    Replies:
    0
    Views:
    440
    Davmagic .Com
    Oct 14, 2004
  2. JohnZing

    list of drop downs

    JohnZing, Jan 30, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    401
    JohnZing
    Jan 30, 2005
  3. =?Utf-8?B?TWlrZQ==?=

    dual drop downs

    =?Utf-8?B?TWlrZQ==?=, Mar 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    551
    =?Utf-8?B?VGltIFN0YWxs?=
    Mar 9, 2005
  4. BryanS
    Replies:
    0
    Views:
    418
    BryanS
    Mar 16, 2005
  5. jaysch
    Replies:
    0
    Views:
    1,224
    jaysch
    Apr 30, 2011
Loading...

Share This Page