How can I change this code to make it when someone doesn’t fill out a field correctly change the text for the field that is in a span tag. Right now it changes the color of the span to red, but I want to dynamically add a *
////////////////////////////////////JAVASCRIPT PART/////////////////
function chkName(form) {
var fullname = document.contactForm.name.value;
var name = document.contactForm.name.value.indexOf(” “, 0);
if(document.contactForm.name.value == “”) {
alert(“Please enter your name”);
document.getElementById(“tag1”).style.color = “red”;
document.contactForm.name.focus();
return false;
}
////////////////////////////////////////////////HTML//////////////////
<span id=”tag1″>Name:</span><br />
<input type=”text” size=”25″ name=”name” style=”border: 0″ /><br />
Any help would be appreciated big time.
[url]www.momaddidley.com