jQuery serialize()

jQuery serialize()

ralph.rylralph.ryl Posts: 13Questions: 1Answers: 0

Dear Allan,

while I have problems with multi-filter-select and the option scrollx/scrolly I decided to make an select-filter on some columns in my table and filter them per php and database query. So my tableheader looks like:

...<thead><th>COLUMNNAME<form><select name="year"><option>all</option><option>2000</option><option>2001</option></select></form></th>

Now the from goes over the whole table for possibility to filter more columns. But this is not the problem. My problem is when I use the jQuery-function serialize in the header (th) I get two values from the form (once the default value and the selected value). I make an array for POST to submit the form and the second value from in this case "year" is the default (all). So the selected value i.e. 2001 overwrites.
You can see this in the console.log-output:

'pdf':'all'
'example_length':'10'
'yearform':'2007'
'yearform':'all'
({'pdf':'all'}),({'example_length':'10'}),({'yearform':'2007'}),({'yearform':'all'}),

I don't know how to fix the problem. Maybe you have an idea.

Thanks

Ralph

Replies

  • allanallan Posts: 61,642Questions: 1Answers: 10,093 Site admin

    Hi Ralph,

    Can you link me to the page in question so I can take a look please?

    Allan

  • ralph.rylralph.ryl Posts: 13Questions: 1Answers: 0

    Hi Allan,

    I send you a message with the link

    Ralph

  • ralph.rylralph.ryl Posts: 13Questions: 1Answers: 0

    Hi Allan, did you get the message and have take impression from the problem?

    Ralph

  • allanallan Posts: 61,642Questions: 1Answers: 10,093 Site admin

    I've just posted a reply in the PM.

    Allan

This discussion has been closed.