Friday 15 August 2014

serialization - jquery select form, filter with chained find fails - returns empty result -


I have a form with many input elements and need to be sorted - convert to HTTP query string it works fine Then I wanted to get rid of one of the input values, so I used to select all those elements which are not equal to one; She works fine but then I tried to remove two searches together and it failed.

I know that disabling unwanted inputs or removing multiples of the name will also work, but these options are not intelligent in my application.

I have a JSF to show me:

Let me summarize here. This is such a form:

  & lt; Form & gt; & Lt; Input type = "text" name = 'a' value = 'a' & gt; & Lt; Input type = "text" name = 'bb' value = 'bb' & gt; & Lt; Input type = "text" name = 'cc' value = 'cc' & gt; & Lt; / Form & gt;   

jquery code like this:

  query_args = $ ('# form'). Serialize (); Alerts (query_args); // looks fine query_args = $ ('# form'). ('' [Name! = "Bb"] '). Serialize (); Alerts (query_args); // very good, 'BB' query_ args = $ ('# form') has gone. ('[Name = = "BB"]'). Search ('[name! = "Cc"]'). ); Alerts (query_args); // failed! Nothing has been shown.   

If I have done some dumb Nob fault now, please try to be good!

This should be form_args = $ ("# actions"). ("[Name! = 'Cc'] [name! = 'Ee']"). );

Find the name of element attribute! = CC and name! = DD

No comments:

Post a Comment