Skip to content Skip to sidebar Skip to footer

Selectbox Without Submit Button

I want to POST my values from selectbox without submit button. And want to get values as automatically drop down menu selects value Trying below sample code but isnt getting requir

Solution 1:

Since you rely on the submit button value you need to emulate clicking it:

<select name="modelS" onchange="this.form.elements['alldetails'].click();">

Just submitting the form won't put a value in $_POST['alldetails'].

Solution 2:

<selectname="modelS"onChange="submit(this);"><scriptlanguage="text/javascript">functionsubmit(formField) {
        jQuery(formField).closest('form').submit();         
    }
</script>

Post a Comment for "Selectbox Without Submit Button"