Monday 15 September 2014

html - Have trouble in onchange submit form -


I am going to submit an on-change form, but this is not working for me. I am using PHP loop to get value in options under

Here is the code:

  & lt; Select id = "agnt_name" name = "agnt_name" style = "font-weight: bold; font-size: 13px; height: 25px; vertical-alignment: central;" onchange = "this.form.submit ()" & gt; ; & Lt ;? Php $ agentname_query = mysql_query ("SELECT id, lname, fname" order by agent "fname"); While ($ agentname_fetch = mysql_fetch_array ($ agentname_query)) {$ agentname_id = $ agentname_fetch ['id']; $ Agentname_fname = $ agentname_fetch ['fname']; $ Agentname_lname = $ agentname_fetch ['lname']; ? & Gt; & Lt; Option & lt ;? Php if ($ select_agent == $ agentname_id) {echo 'selected =' selected '';} ?? gt; value = "& lt ;? Php echo $ agentname_id ;? & Gt; "& gt; & lt ;? php echo strtoupper ($ agentname_fname); & gt; & lt; php echo strtoupper ($ agentname_lname) ;? & gt; & lt; / option & gt; & lt; ? Php}? & Gt; & gt; Selection & gt;   

If I submit the form without changing the value in the drop-down of the form, Can not submit because I have not changed the value, so I tried to enter one more option:

  & lt; option value = "" & gt; select one & lt; / Option & gt;   

It's still not working from my end. Use auto-fill for pages is jquery bellow: