Modeling jquery change event

I have five lists (select) that populate php / mysql and jquery. I am using this script: http://bit.ly/3YTAXe

When I submit my form and a new page appears, I redraw my five lists and I want my 5 lists to be populated with the values ​​published.

I think I would have to simulate an “change” event or something like that. I don't think my code can help (it's inside smarty and more).

Can anyone help me with the example code in the link above?

+7
source share
2 answers

try .trigger ()

$('#yourselect').val('yourvalue');
$('#yourselect').trigger('change');

It can also be combined into one statement:

$('#yourselect').val('yourvalue').trigger('change');
+10

post- , "" . , 3 :

  • cookie javacript cookie.
  • jquery $.post .

. jquery ajax . , "event.preventDefault" ( $('form'). Submit). "action =" , $.post( $.post).

+1

All Articles