Search Results

Search found 2 results on 1 pages for 'cnobile'.

Page 1/1 | 1 

  • After dynamically changing a form submit function causes old function to get called once then new fu

    - by cnobile
    I am setting the submit function on a form with jQuery then later in the process I reset the function to something else. What happens is the original function gets called again then the new function when only the new function should have been called. I am sending the requests with AJAX. The first one validated the values on the server then asks if you want to continue. Clicking the submit again should only call the changed function but for some reason both get called simultaneously with a single click. What is happening here? Could jQuery be delaying the the setting of the 2nd function on the form submit?

    Read the article

  • Filtering foreign keys with AJAX in Django admin

    - by cnobile
    I have most of this figured out already. I have AJAX returning the region/state/province when a country is selected. The correct foreign key is saved to the database, however, when the record is viewed afterwards the selected state is not shown in the select nor are any states for the selected country. I understand why this is happening as, the admin view is not aware of the relation between the state and the country. So here is the question. Is there a hook in the admin view that will allow me to load the correct states for the country and set the selected attribute on the option in the select tag? Or how can I override the admin view for any forms that require the country and region/state/province set? I am using jQuery and Djando-1.1. Thanks

    Read the article

1