Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Read select on same page

    I want to display the value of hcatagorie in the header when it refreshes. However i keep gettin a undifened error.


    Code:
    <select name="hcatagorie" class="select" 
    onchange="window.location='?id=vraag&hcatagorie='
    +document.vraag.hcatagorie.value">
    can anybody help me with this thx in advance

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    If the page does not have to be refreshed then you could go

    <select name="hcatagorie" class="select" onchange="document.getElementById('header').innerHTML=document.vraag.hcatagorie.value">

    otherwise something like this maybe

    Code:
    <HTML>
    <HEAD>
    <TITLE>Document Title</TITLE>
    
    <script type="text/javascript">
    
    onload=function test(){
    if (location.search.length > 0){
    dataPassed = unescape(location.search.substring(1))
    
    document.getElementById("header").innerHTML=dataPassed.split("&")[1].split("=")[1]
    
    }
    
    
    }
    
    
    </script>
    </HEAD>
    <BODY>
    <div id="header"></div>
    
    <form name="vraag">
    <select name="hcatagorie" class="select" onchange="window.location='?id=vraag&hcatagorie='+document.vraag.hcatagorie.value">
    <option value="0">0
    <option value="1">1
    <option value="2">2
    <option value="3">3
    </select>
    
    </form>
    
    </BODY>
    </HTML>
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    re

    Thx that worked


  •  

    Posting Permissions

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