suppose I\'ve a 3 options in a drop down box say red , blue, others. If a user select option as an others then below a text box should be visible to wrtie his own favour
This will submit the right form response (i.e. Select value most of the time, and Input value when the Select box is set to "others"). Uses jQuery:
$("select[name="color"]").change(function(){
new_value = $(this).val();
if (new_value == "others") {
$('input[name="color"]').show();
} else {
$('input[name="color"]').val(new_value);
$('input[name="color"]').hide();
}
});