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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autofill highlight in yellow 3

Status
Not open for further replies.

gmmastros

Programmer
Feb 15, 2005
14,910
US
I'm working on an on-line survey. I notice that some of the text boxes I put on the screen are highlighted in yellow and I can't seem to get rid of it.

If I do this:

Click on the 'options' button of the google tool bar
Click 'AutoFill Settings'
Uncheck 'highlight fields on web pages that AutoFill can update in yellow'

Then the yellow highlighting goes away. The problem is that my customers see the yellow highlighting and are complaining about it. Of course, I could show them how to modify their settings, but I would prefer to fix the problem on the ASP side of things so that it doesn't matter what their browser settings are.



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
one more thing...you can also add this attribute autocomplete="off" to the form tags if there are lot of input and text tags...

instead of adding for each of them...you can add once for the whole form...

-DNG
 
That doesn't appear to have any effect. Maybe I didn't put the autocomplete="off" in the right place. You'll notice that it appears in 2 places. I tried each one seperately, and then combined. Still no luck.

Here is part of the 'view source' for the page. Maybe I'm doing something wrong.

Code:
<html>
    <head>
        <title>
            This is the title
        </title>
        <link type="text/css" rel="stylesheet" href="css_main.css"/>
        <link type="text/css" rel="stylesheet" href="css_header.css"/>    
        <link type="text/css" rel="stylesheet" href="css_footer.css"/>    
        <link type="text/css" rel="stylesheet" href="css_error.css"/>
        <link type="text/css" rel="stylesheet" href="css_drug.css"/>
        <link type="text/css" rel="stylesheet" href="css_language.css"/>    
        <link type="text/css" rel="stylesheet" href="css_progressbar.css"/>    
        <link type="text/css" rel="stylesheet" href="css_question.css"/>
        <link type="text/css" rel="stylesheet" href="css_button.css"/>
   </head>
    <body>

<form method="post" autocomplete="off">
    <input type=hidden name=Page value=3 />

    <table class="question">
        <tr class="question">
            <td class="question">a. Number of days in hospital:</td>
            <td class="question"><input type=text name=DaysInHospital maxlength=2 size=4 autocomplete="off" value="" /></td>
        </tr>

  [b] other stuff removed[/b]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Or you can put this in the <head>. I got this from:


<script type="text/javascript"><!--
if(window.attachEvent)
window.attachEvent("onload",setListeners);

function setListeners(){
inputList = document.getElementsByTagName("INPUT");
for(i=0;i<inputList.length;i++){
inputList.attachEvent("onpropertychange",restoreStyles);
inputList.style.backgroundColor = "";
}
selectList = document.getElementsByTagName("SELECT");
for(i=0;i<selectList.length;i++){
selectList.attachEvent("onpropertychange",restoreStyles);
selectList.style.backgroundColor = "";
}
}

function restoreStyles(){
if(event.srcElement.style.backgroundColor != "")
event.srcElement.style.backgroundColor = "";
}//-->
</script>
 
emozley,

Your suggestion has solved my problem. I have an include file for the header. I popped the code in there, and it 'fixed' every page. Thanks.



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
actually there is a much simpler answer (apart from get some intelligent users who know they have the Google toolbar installed!!!!!)

Simply change the names of the form fields to something other than

firstname
surname
address
etc

a little experimenting will tell you what the Google Toolbar recognises.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
I gave that a try but it doesn't seem to work - I think the toolbar must look at text near the form element to decide what it is. I even tried turning the word 'Email' into ASCII codes in the same way I encode email addresses to stop them being harvested but the toolbar was still able to read it.

E.
 
I tried playing around with the names of the form fields too. The google toolbar must looks for 'more than' a static list of names because other/weird names were getting highlighted. I prefer to name form items sensibly because it makes the programming easier.

After having worked with this a little bit, I decided to implement BOTH fixes. By using emozley's code, I was able to remove the yellow background, which is good.

By implementing DotNetGnat's solution, I was able to prevent the drop down (auto-complete) list. This is important for the application that I am developing. So, star for DNG also.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top