Hi,

I have created a form, with a mixture of input text boxes and text area's, but when I view the form some of the input boxes are white, and some are yellow?

I have looked at the code and as fas as i can see they should all be white. The backgroupd colour properties of the input fields are all set to white.

Am I missing something.

Also

When I submit the form data is written to my sql database. Using the behaviours, I can then on click foreward to a thankyou page - which is ok, but, if I put form processing in, and there are errors, so I have on click form validate and on click got thankyou form; if there are errors, and I say 'ok' to the errors it then goes to the thankyou page !! using dreamweaver, how can I stay on the form until there are no errors and then post my db entry and move foreward.

thanks

Dani AI

Generated

A few practical checks and fixes that extend the replies here by and .

If some inputs look different while others look white, first rule out environment vs. code: test the page in another machine, a different browser, or an incognito window (extensions and toolbars are often the culprit). Use the browser devtools, inspect the element and view the computed styles to find which rule (background, box-shadow, or a pseudo-class like :-webkit-autofill) is changing the appearance. Also check for differences in disabled or readonly state, or a parent rule with higher specificity overriding the expected background.

To neutralize the common Chrome/Safari autofill coloring, the usual approach is to override the autofill pseudo-class. Example (use sparingly — it removes the autofill visual cue):

input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
  box-shadow: 0 0 0px 1000px #fff inset !important;
  -webkit-text-fill-color: #000 !important;
}

For the submit/validation flow: client-side validation must prevent submission when there are errors. Avoid relying on a submit-button onclick that also triggers a redirect — behaviors can run in sequence and cause the redirect even after an error dialog. Attach validation to the form submit event, call event.preventDefault() on failure, and only allow normal submit when validation passes. Example pattern:

<form id="myForm">
  ...
</form>

<script>
document.getElementById('myForm').addEventListener('submit', function(e) {
  if (!validateForm()) {
    e.preventDefault();
  }
});

function validateForm() {
  var name = document.getElementById('name');
  if (!name.value.trim()) {
    alert('Please enter a name');
    name.focus();
    return false;
  }
  return true;
}
</script>

Always keep server-side validation as the authority and perform the final redirect from the server after a successful DB insert (or respond with a success page). Quick troubleshooting: test without extensions, inspect computed styles, and log validation flow in the console so you can see exactly which handlers run and in what order.

Recommended Answers

All 2 Replies

Are you by any chance using the Google Toolbar? The toolbar's AutoFill feature will highlight form fields in yellow if it thinks it can fill them in with your personal information. Clicking the AutoFill button in the toolbar will do just that.

I'm confused on your second question.

Dani

Many thanks for your reply - regarding the colours - you were correct, it was ok when I looked at the site on a different computer. I just presumed it was my coding.

With regards to the second question - I have now solved this - I can redirect to a different url after the database has been updated rather than try and re-direct from the submit button.

thanks again

dave

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.