I have a search form and a results form on the same page. I reload the values in the search form (by receiving a parameter) so that the user can see what filters are being used to get the current results.
This works great except...
When I try and use the reset() form method it will not remove values that were previously submitted. I have also tried explicitly setting the value in those fields to nothing using something like this:
This does clear the checkboxes but will not clear the text fields if they have already been submitted in a query. I have attached an screenshot of the search filters.
Any suggestions of how to solve this or work around the issue would be greatly appreciated.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
SDmesaweb
I have a search form and a results form on the same page. I reload the values in the search form (by receiving a parameter) so that the user can see what filters are being used to get the current results.
This works great except...
When I try and use the reset() form method it will not remove values that were previously submitted. I have also tried explicitly setting the value in those fields to nothing using something like this:
function clearForm ()
{
document.getElementsByName('cbParamVirtual7')[0].value="";
document.getElementById('cbParamVirtual17').value="";
document.getElementById('cbParamVirtual18').value="";
document.getElementById('cbParamVirtual19').value="";
document.getElementById('caspioform').reset();
}
This does clear the checkboxes but will not clear the text fields if they have already been submitted in a query. I have attached an screenshot of the search filters.
Any suggestions of how to solve this or work around the issue would be greatly appreciated.
Thanks,
Joel
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.