TheInsider
Programmer
Hi,
I'm new to client-side scripting with Javascript, so please forgive me for asking such a simple question. I have searched this forum but I can't seem to find the answer. What I have is a user registration form. Here users enter data such as their first name, last name, etc. and then click submit. I have the form structured with a table to make the layout look nice. The label text goes in the left column, the text box in the right. When the user clicks the submit button, I will check to see if the text boxes are filled in, and if the value of any fields are missing, I will change the color of the text in the corresponding label to red. I know that I can wrap the label text in <p></p> tags and set the onfocus="this.style.color = 'red'" -- this works. However, how do I change the color in an event that doesn't belong to this tag -- i.e. the submit button's onclick event? Hopefully NN and EI compatible... which brings me to my final question: I am planning on using client-side script with DHTML to display on the screen when a user doen't fill in a required text field. I am using client-side script, as opposed to server-side script, to cut down on server load. Would it be better to validate this with ASP, and return a page with the highlighted text if necessary?
Thanks, Rob Marriott
rob@career-connections.net
I'm new to client-side scripting with Javascript, so please forgive me for asking such a simple question. I have searched this forum but I can't seem to find the answer. What I have is a user registration form. Here users enter data such as their first name, last name, etc. and then click submit. I have the form structured with a table to make the layout look nice. The label text goes in the left column, the text box in the right. When the user clicks the submit button, I will check to see if the text boxes are filled in, and if the value of any fields are missing, I will change the color of the text in the corresponding label to red. I know that I can wrap the label text in <p></p> tags and set the onfocus="this.style.color = 'red'" -- this works. However, how do I change the color in an event that doesn't belong to this tag -- i.e. the submit button's onclick event? Hopefully NN and EI compatible... which brings me to my final question: I am planning on using client-side script with DHTML to display on the screen when a user doen't fill in a required text field. I am using client-side script, as opposed to server-side script, to cut down on server load. Would it be better to validate this with ASP, and return a page with the highlighted text if necessary?
Thanks, Rob Marriott
rob@career-connections.net