Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable HTML Form auto dropdown list

Status
Not open for further replies.

JNameNotTaken

Programmer
Aug 29, 2006
24
0
0
IE
Hi All

Any of you who have read any of my previous posts will know that I am very much a beginner to Perl so please bare with me here.

My (latest) problem is this.

MS internet explorer 'remembers' what has been entered into HTML forms by default. So when you go back to the form a list of previous entry’s is presented at each field of the form. For a form I've created, I do not want previous entry’s to be remembered. The form is generated dynamically using a perl CGI script.

I am not sure what this is called thus have not had any luck googling the matter.

Despite my efforts I have been unable to prevent this from happening using Internet Explorer's own menu (deleting cookies & history had no effect) this is one problem that does concern me but I actually want to do this from a Perl CGI script if possible. I mean, disable this feature for my form alone. I don't mean accessing any of Explorers functions from the script.

Any pointers would help very much. I'm not expecting anyone to actually write code here. If you could even tell me what this 'remembering' thing that internet explorer does is is called it would help immensely.

Sincerely, Thanks Again
John
 
if you timestamp your fields, you wouldn't have this issue.
You can then iterate over the CGI->params to get a list of all the fields, and then just truncate the timestamp.

Just a thought.

<input name="name_1157383443">

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Thanks PaulTEG,

but, I'm not sure I understand what you mean.

I don't see how using <input name="name_timestamp> will help. Is the name of the field not totally arbitrary?

I don't know how this will prevent a drop down list of previously entered data from appearing as soon as the user types something into that field?

Perhaps I have missed something fairly obvious in your reply? Or perhaps I my explanation of the problem was misleading?

Thanks
John

 
you can iterate over your input list and split off the timestamp, and assign your input variables to regular variables.

Code:
 use CGI;
 my $q=new CGI;
 my %params;
 @names = $q->param;
 foreach (@names) {
   ($param, $timestamp)=split /_/, $_;
   $params{$param}=$q->param($_);
 }
Might require a little tweaking if you're uploading files ...

This just so that IE won't have had a field with your given names in the past. Widespread use of a technique like this would no doubt cause issues for IE with the feature enabled because of the bloat over time, because of the unique names it would have to store.

Using IE7 beta, don't have IE 6.0 anymore, the feature you refer to was called AutoFill, and I *think* is now called 'inline AutoComplete'. IMO, that's always been a security weakness in any browser

HTH

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Perl can not over-ride auto-completing of form fields by the browser. You can set IE to not auto-fill forms, it should be in the Tools>>Internet Options>>Content>>AutoComplete menu.
 
In the same place in IE7 ...

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
PaulTEG,

Thanks for explaining, I understand what you mean now and it is certainly a tip I'll be holding onto. Unfortunatly it doesn't solve my immediate problem.

In a nut shell: -

I present a field to the user where they input a number.
After submission I then present a different field to the user where they are supposed to re-type the number. The numbers from both fields are compared to help ensure no typos.
The problem is that IE's "Auto Fill" (thanks guys) defeats the purpose of this by presenting the first number entered in the drop down list at the second field. User just selects this and doesn't type the number. Thus any mistake made when entering the number the first time is repeated.

KevinADC - Thanks for that. Not being able to find it drove me daft for ages.
I guess I'll have to rely on people having enough sinse to actually type the number twice .... Hmmmmm..

 
different field names are what you want then

<input name="entry1" type="text">

<input name="entry2" type="text">

Another possibility is to use a textarea with 1 row, and style out the auto scrollbars


Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Different field names>

Great I'll try that. Currently they are named the same.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top