0

My form is like the above

<form method="post" name="publishResult" onsubmit="return g(this);">
    <select  id="options1" name="se1"  >
    		<option value="0" >-- Grade --</option>
                <option value="A+">A+</option>
                <option value="A">A</option>
                <option value="A-">A-</option>
                <option value="B+">B+</option>
                <option value="B">B</option>
                <option value="B-">B-</option>
                <option value="D">D</option>
                <option value="F">F</option>
      </select>
       <select  id="options2" name="se2"  >
    		<option value="0" >-- Grade --</option>
                <option value="A+">A+</option>
                <option value="A">A</option>
                <option value="A-">A-</option>
                <option value="B+">B+</option>
                <option value="B">B</option>
                <option value="B-">B-</option>
                <option value="D">D</option>
                <option value="F">F</option>
      </select>
        <select  id="options3" name="se3"  >
    		<option value="0" >-- Grade --</option>
                <option value="A+">A+</option>
                <option value="A">A</option>
                <option value="A-">A-</option>
                <option value="B+">B+</option>
                <option value="B">B</option>
                <option value="B-">B-</option>
                <option value="D">D</option>
                <option value="F">F</option>
      </select>

 <input type="submit" name="submit_result" />
</form>

onsubmit="return g(this);" here i want to get all the selected value of the 3dropdown list...Can any-one help me???

Edited by six_sic6: n/a

2
Contributors
4
Replies
10
Views
6 Years
Discussion Span
Last Post by six_sic6
0

Are you wanting to pass all the values to the function or have all the values returned from the function?

I want to pass all the values to the function so that i can pass these values through AJAX

0

Can you use getElementById in the function? Or, use it to pass to the function?

If you form submit is calling a function, then in that function you can get each value:

function formSubmit() {
  opt1val = document.getElementById('options1').value;
  opt2val = document.getElementById('options2').value;
  opt3val = document.getElementById('options3').value;

  // do something with those values
}

Would that work?

0

Can you use getElementById in the function? Or, use it to pass to the function?

If you form submit is calling a function, then in that function you can get each value:

function formSubmit() {
  opt1val = document.getElementById('options1').value;
  opt2val = document.getElementById('options2').value;
  opt3val = document.getElementById('options3').value;

  // do something with those values
}

Would that work?

thnxxx man it workde...:)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.