To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > ClientSide Technologies

ClientSide Technologies Discuss HTML/CSS/Javascript, and any other client-side technologies, here.

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-28-2006, 08:39 AM   #1
cassius
Senior Member
 
Join Date: Feb 2003
Location: Norway
Posts: 120
yellow backround in certain form elements ?

I'm experiencing that some of my form elements gets a yellow background color. Does anyone else have this same problem and know a workaround for this(it looks kind of strange) ?

It happens to <input type="text">-elements, but I can't see a connection because it doesn't happen to all text-input elements...

Help would be much appreciated.
__________________
[~cassius~]
cassius is offline   Reply With Quote
Old 04-28-2006, 08:46 AM   #2
Houdini
Lost in Time (1970's)
 
Houdini's Avatar
 
Join Date: Jul 2004
Location: Nashville TN USA
Posts: 1,932
That is the browser behavior it is not your code, probably Firefox but it is not your code.
Houdini is offline   Reply With Quote
Old 04-28-2006, 09:07 AM   #3
cassius
Senior Member
 
Join Date: Feb 2003
Location: Norway
Posts: 120
Changed name and that did it ??

I've tried different stuff now to remove the background color now, but the solution seemed to be to change the name of the field allthough I have no idea why this solved my problem. All fields had unique names before this workaround, so this doesn't explain the problem.

Let me know if anybody know why this happens:
Code that turn fields yellow:
PHP Code:
<div align="right"><span class="apptxt"><?php echo $navn[$lang]; ?></span> </div>
    <td><input name="sambofirstname" type="text" class="formstyle" id="sambofirstname" size="30"
    <?php if(isset($_POST['sambofirstname']) && $_POST['sambofirstname'] != ""){ echo "value='".$_POST['sambofirstname']."'"; }?>>
    </td>
<div align="right"><span class="apptxt"><?php echo $etternavntxt[$lang]; ?></span></div>
    <td><input name="sambosurname" type="text" class="formstyle" id="sambosurname" size="30"
    <?php if(isset($_POST['sambosurname']) && $_POST['sambosurname'] != ""){ echo "value='".$_POST['sambosurname']."'"; }?>>
    </td>
Code that didn't turn fields yellow:
PHP Code:
  <div align="right"><span class="apptxt"><?php echo $navn[$lang]; ?></span> </div>
    <td><input name="sambofirst" type="text" class="formstyle" id="sambofirst" size="30"
    <?php if(isset($_POST['sambofirst']) && $_POST['sambofirst'] != ""){ echo "value='".$_POST['sambofirst']."'"; }?>>
    </td>
<div align="right"><span class="apptxt"><?php echo $etternavntxt[$lang]; ?></span></div>
    <td><input name="sambosurname" type="text" class="formstyle" id="sambosurname" size="30"
    <?php if(isset($_POST['sambosurname']) && $_POST['sambosurname'] != ""){ echo "value='".$_POST['sambosurname']."'"; }?>>
    </td>
Another thing, both fields had yellow background with the first example of code, none of them had background color with the second example of code(allthough i didn't change anything with the field name "sambosurname").

This is the corresponding css style if it matters:
HTML Code:
<style>
.formstyle{
	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 8pt;
	border-right: #CCCCCC 1px solid;
	border-top: #CCCCCC 1px solid;
	border-bottom: #CCCCCC 1px solid;
	border-left: #CCCCCC 1px solid;
	color: #000000;
}
</style>
__________________
[~cassius~]

Last edited by cassius; 04-28-2006 at 09:15 AM.
cassius is offline   Reply With Quote
Old 04-28-2006, 09:20 AM   #4
Houdini
Lost in Time (1970's)
 
Houdini's Avatar
 
Join Date: Jul 2004
Location: Nashville TN USA
Posts: 1,932
After you run the code a couple of time you might notice that the yellow background returns, the reason for this is that the browser will remember certain field types of a form with a certian name attribute, you know like when it automatically completes the field as you are typing into ceratin fields like your name your address your city and state, well it is remebering the name of that text field and adds it to a list and when it sees it it will turn the background yellow and if you start typing your name you will see the dropdown with the information you usually put in, it is not your code.
Houdini is offline   Reply With Quote
Old 04-28-2006, 09:58 AM   #5
cassius
Senior Member
 
Join Date: Feb 2003
Location: Norway
Posts: 120
Ok

OK. I thought of that, but I couldn't figure out why it did this for just some of the 20 form fields in this application form. There's only the two fields supplied in my code that got the yellow background, none of the other form elements are supplied with this color(allthough the form is loaded/filled out/submitted the same number of times).

FF displayed it right.
__________________
[~cassius~]
cassius is offline   Reply With Quote
Old 04-29-2006, 01:53 AM   #6
bpat1434
NMaOtBG
 
bpat1434's Avatar
 
Join Date: Oct 2004
Location: Around 255.255.255.0
Posts: 8,093
are you sure there's not CSS correlated to #sambosurname and #sambofirstname
bpat1434 is offline   Reply With Quote
Old 04-29-2006, 08:34 AM   #7
cassius
Senior Member
 
Join Date: Feb 2003
Location: Norway
Posts: 120
yes I'm sure

I'm sure there's no css related to those names or css-styles with that name.
__________________
[~cassius~]
cassius is offline   Reply With Quote
Old 04-29-2006, 08:51 AM   #8
MarkR
Senior Member
 
Join Date: Jul 2004
Location: Oxford, England
Posts: 1,983
I think you've got a browser extension such as autofill, or Google toolbar which is overriding the page style.

I don't know whether maybe by using the nonstandard attribute autocomplete, you can prevent this behaviour, but that may not be desirable.

Mark
MarkR is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 09:20 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.