SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Evangelist dscriptor's Avatar
    Join Date
    Oct 2005
    Location
    in front of my computer
    Posts
    571
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question location.href in IE not working

    hi all,

    can someone help me why this piece of code is not working in IE?

    <select name="filt">
    <option>Select...</option>
    <option value="all" onclick="window.location.href = 'employeemain.php?page=call_reports&filt=all'">All</option>
    <option value="today" onclick="window.location.href = 'employeemain.php?page=call_reports&filt=today'">Today</option>
    <option value="week" onclick="window.open('inputweek.php','Service','width=400,height=270,left=300,top=200,scrollbars=yes')">Weekly</option>
    <option value="month" onclick="window.open('inputmonth.php','Service','width=400,height=270,left=300,top=200,scrollbars=yes')">Monthly</option>
    </select>
    it is working in Firefox, but in IE it isn't...

    why? please help me...

    thanks!
    happy is the man that finds wisdom....wisdom in {PHP}.


  2. #2
    SitePoint Enthusiast RaS!'s Avatar
    Join Date
    Mar 2004
    Location
    Italy
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, what about using onChange instead of onClick?
    This message was written using 100% recycled electrons

  3. #3
    SitePoint Evangelist dscriptor's Avatar
    Join Date
    Oct 2005
    Location
    in front of my computer
    Posts
    571
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can't do it, because the first option is to reference the url in the same window, but the last two options, when clicked,, it will open a new window.
    happy is the man that finds wisdom....wisdom in {PHP}.


  4. #4
    SitePoint Evangelist dscriptor's Avatar
    Join Date
    Oct 2005
    Location
    in front of my computer
    Posts
    571
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone ?....
    happy is the man that finds wisdom....wisdom in {PHP}.


  5. #5
    SitePoint Enthusiast Josty's Avatar
    Join Date
    Jun 2006
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about doing this:
    onchange="myFunction();"

    And inside myFunction you could do the different stuff, popup and redriecting. It seems as the onclick-function simply will not work that way. :S

  6. #6
    SitePoint Zealot sajjad's Avatar
    Join Date
    May 2005
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear dscriptor , try this one
    between head section add this code
    <script language="javascript">
    function go(){
    if(document.form1.filt.value=="all" || document.form1.filt.value=="today")
    window.location="index.html";
    if(document.form1.filt.value=="week" || document.form1.filt.value=="month")
    window.open('company.html','Service','width=400,height=270,left=300,top=200,s crollbars=yes');

    }
    </script>


    and then in body add this

    <form name="form1" method="post" action=""><select name="filt" onChange="go()"
    id="filt">
    <option >Select...</option>
    <option value="all">All</option>
    <option value="today">Today</option>
    <option value="week">Weekly</option>
    <option value="month">Monthly</option>
    </select>

    </form>


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
  •