Spring Spring-JS vs JQuery form submit
I am working on a Spring Webflow project that was builded with Spring-JS but the firm is requesting me to change the following code to use JQuery. I am NOT a JavaScript/JQuery programmer so I do need some help with now..
Below is working code that on a change of a selectbox (called borough) it will change the _eventID(need it for webflow) to loadSchools and then do a form submit of everything on the pages. I been trying for days to get this working in JQuery but nothing is working
Below is the old working code using Spring-JS
- <script type="text/javascript">
- Spring.addDecoration(new Spring.AjaxEventDecoration({
- elementId: "borough",
- formId: 'member',
- event: "onchange",
- params: {_eventId: 'loadSchools', fragments: 'contents'}
- }));
- </script>
Here is the code I been working on that DON'T work:
- <script type="text/javascript">
- $(document).ready(function () {
- $("#borough").change(function() {
- $('input[name="_eventId"]').val('loadSchools').appendTo('#member');
- $('#member').submit();
- });
- });
- </script>