Activating IE's AutoComplete without "submitting" the form?
Category Software Development
I'm having an issue with an application, and perhaps you can help me out since I'm still less than proficient on the web stuff...
I have a form that is used for searching. There's a field you use to put your search term in, and then you click the submit button (or hit enter). On the OnSubmit event, there's a call to the doSearch function which ends up returning the results of the search on a customized form. After the doSearch function, there's a return false. So in effect, the form never gets fully "submitted".
IE's AutoComplete function will give you a dropdown list of values for a field if the field name matches a field name for which IE has stored values. After experimenting around with my app, it appears that the value of the field gets stored (and is available the next time the form is used) when the form gets submitted. Since I'm doing a return false as part of my onSubmit, it never gets stored. If I don't do the return false, it will store the value, but I get a 500 HTTP error because it tries to submit some long hairy URL when you look at the log.
I may just have to tell the user that the AutoComplete function won't work the way the application is designed. However, if there's some way I can fake IE into thinking the form is submitted while actually just displaying the returned search results, that would be cool...
Any ideas?
I'm having an issue with an application, and perhaps you can help me out since I'm still less than proficient on the web stuff...
I have a form that is used for searching. There's a field you use to put your search term in, and then you click the submit button (or hit enter). On the OnSubmit event, there's a call to the doSearch function which ends up returning the results of the search on a customized form. After the doSearch function, there's a return false. So in effect, the form never gets fully "submitted".
IE's AutoComplete function will give you a dropdown list of values for a field if the field name matches a field name for which IE has stored values. After experimenting around with my app, it appears that the value of the field gets stored (and is available the next time the form is used) when the form gets submitted. Since I'm doing a return false as part of my onSubmit, it never gets stored. If I don't do the return false, it will store the value, but I get a 500 HTTP error because it tries to submit some long hairy URL when you look at the log.
I may just have to tell the user that the AutoComplete function won't work the way the application is designed. However, if there's some way I can fake IE into thinking the form is submitted while actually just displaying the returned search results, that would be cool...
Any ideas?



Comments
Posted by Duffbert At 21:08:41 On 10/11/2004 | - Website - |
Posted by Brian Benz At 17:57:16 On 10/11/2004 | - Website - |
Posted by At 06:44:27 On 11/03/2006 | - Website - |
First I take this opportunity to congratulate you for your so intelligent site and articles. I heard about you via Joe Litton, your co-team-TSG.
About your problem: I suggest that the action of the form is the JavaScript code. This way you will both submit the form and perform the action. Something like:
<form method="GET" action="javascript: myFunction();">
What do you think about this?
Kind regards,
Lionel
Posted by Lionel At 23:37:14 On 09/11/2004 | - Website - |
AutoCompleteSaveForm Method
{ Link }
Posted by OZ At 20:58:08 On 22/07/2011 | - Website - |
Posted by Rakesh At 05:49:52 On 10/01/2012 | - Website - |