开发者

jquery serializeArray form a disabled form

开发者 https://www.devze.com 2023-02-20 18:50 出处:网络
I\'m trying to create an xml string from all of my form inputs, it works only if the form is enabled. how can i create the xml when all of the form inputs are disabled?

I'm trying to create an xml string from all of my form inputs, it works only if the form is enabled. how can i create the xml when all of the form inputs are disabled?

Thank's In Advan开发者_JS百科ce.


Disabled form controls are not submitted when the form is submitted. You could do this:

  1. Create a submit handler for the form.
  2. Inside the submit handler, create a clone of the form.
  3. Un-disable all of the form controls in the clone.
  4. AJAX submit using the serialized data from the clone.
  5. When the AJAX call returns, load whatever page you would have loaded in the originial submit.

Don't forget to return false at the end of the submit handler.

0

精彩评论

暂无评论...
验证码 换一张
取 消