Вот моя форма (на php):
Код: Выделить всё
public function form_creation() {
$html = '';
$html .= '';
$html .= '';
$html .= __('Language', 'mon-plugin');
$html .= '';
$html .= '';
$html .= '';
$html .= '';
$html .= __('Program', 'mon-plugin');
$html .= '';
$html .= '';
$html .= '';
$html .= '';
$html .= __('Country', 'mon-plugin');
$html .= '';
$html .= '';
$html .= '';
$html .= '';
$html .= __('City', 'mon-plugin');
$html .= '';
$html .= '';
$html .= '[i] $html .= htmlspecialchars(json_encode($this->backend_select_category));
$html .= '"/>';
$html .= '';
$html .= '[/i]';
$html .= __('Search', 'mon-plugin');
$html .= '';
$html .= '';
return $html;
}
Код: Выделить всё
jQuery('#search_projects').submit(function() {
var selection_value = [
jQuery('#select_langue').val(),
jQuery('#select_program').val(),
jQuery('#select_country').val(),
jQuery('#select_city').val()
];
var selection_display = [
jQuery('#select_langue').children().filter(':selected').text().replace(/\s+/g, '-').toLowerCase(),
jQuery('#select_program').children().filter(':selected').text().replace(/\s+/g, '-').toLowerCase(),
jQuery('#select_country').children().filter(':selected').text().replace(/\s+/g, '-').toLowerCase(),
jQuery('#select_city').children().filter(':selected').text().replace(/\s+/g, '-').toLowerCase()
];
jQuery(this).attr('action', function() {
if (selection_value[1] !== 'nd') {
var action = selection_display[1];
if (selection_value[2] !== 'nd') {
action += selection_display[2];
if (selection_value[3] !== 'nd') {
action += selection_display[3];
}
}
} else {
var action = 'search_program';
}
return action;
});
});
Подробнее здесь: https://stackoverflow.com/questions/463 ... attributes