I seem to be stuck on a small problem, I am trying to create a “Quick Search” box for an ASP system, but I don’t have code-behind access.
How can I submit only the text box value and the submit button value without submitting the ASP or other form elements on the page?
I have tried:
$('#aspnetForm').submit(function() {
var $inputs = $('#aspnetForm :input');
$inputs.each(function() {
if ($("this:not(#QuickSearchBox, #quicksearch-submit)"))
$(this).remove();
});
});
And:
var $inputs = $('#aspnetForm :input');
$inputs.each(function() {
if ($(this).not($("#QuickSearchBox, #quicksearch-submit")))
$(this).remove();
});
But neither of them seem to work.
I am trying to have everything backwards compatible to IE 6 so HTML5 form actions are not an option, and I can’t use nested forms because they don’t validate and do cause some problems.
Is there any way for me to do this?
Disable all the elements that you don’t want submitted.