I’m trying to ‘pre process’ some search criteria in the ‘advanced search’ view of a grid.
How do you pull out the field values in the search js?
I’ve tried this:
nth-child(5) is called "Last Name"
$(’.search-form form’).submit(function(){
line 1 alert($(this).children(’:nth-child(5)’).text());
line 2 alert($(this).children(’:nth-child(5)’).val());
line 3 alert($(this).serialize());
$.fn.yiiGridView.update('itcontact-grid', {
data: $(this).serialize()
});
return false;
});
line 1 correctly displays the field name.
line 3 correctly contains the text "LastName%5D=Jones"
but
line 2 is empty
surely it should contain the value (Jones)?