Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

jQuery

I have a jQuery on Change function.  I need to make it into a onChange or on Submit Function.  I need both,  How do I write that?
<script>
	$(document).ready(function () {
		 $('select').change(function () { 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robert Granlund

ASKER

That did not really work.
Hi,
I created a really small sample here
http://jsfiddle.net/EE_RainerJ/nvvu5mc8/

I prefer to use the "on" handler - but thats the only difference.
Could you perhaps add more info about your scripts?

HTH
Rainer
just attach it to an onchange event handler, and within that code, do a form submit on whatever conditions warrant it:

$('select').change(function () {
       if ( this.val() == 4 )
             $(form).submit();
       else
              .....
}

Open in new window

I wrote earlier that it did not work.  I looked everything over and I had a spelling error.  Sorry for making you post twice.  Thanks for your help!