39 users online (0 members and 39 guests)  


  Results 1 to 2 of 2

Related

  1. Code to Change Picture Based on Drop Down Option Selected    Forum: Website Scripts Forum
    Replies: 9
  2. How to Decode the data from Database using database handler?    Forum: Search Engine Optimization - SEO - Forum
    Replies: 1
  3. Populate fields when checkbox selected    Forum: Javascript Forum
    Replies: 0
  4. Replies: 2
  1. #1
    muna's Avatar
    New User

    Status
    Offline
    Join Date
    May 2008
    Posts
    6

    how to get the selected value in the drop down box to d database can plz help me

    <td width="233" height="23">
    <select name="gender">
    <option value=" "> </option>
    <option value="male">male</option>
    <option value="female">female</option>
    </select>
    </td>
    can anyone give me the script code to get the vale that had been selected from the drpdown bown box.plz help me

  2. #2
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: how to get the selected value in the drop down box to d database can plz help me

    See if this code helps
    HTML Code:
    <td width="233" height="23">
    <select name="gender" id="myopt">
    <option value=" "> </option>
    <option value="male">male</option>
    <option value="female">female</option>
    </select>
    <script type="text/javascript">
    window.onload=function()
    {
    var obj=document.getElementById('myopt');
    obj.onchange=function()
    {
    alert(obj.value); //replace whatever you want either innerHTML or something else.
    }
    }
    </script>



Tags for this Thread