Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Making things appear!


Message #1 by "Alexander Bienz" <alex@v...> on Mon, 11 Mar 2002 09:51:29
Hi there,

I'm currently getting a little more savvy with Javascript and client-side 
validation, for example when a page is submitted an alert box will popup 
if the user has failed to insert relevant data into  a form box.

However I was wondering if it was possible to make characters suck as 
asterisks appear next to these texboxes once the page has failed to 
submit.  I was thinking perhaps a scenario like this...

User has to enter their name into a text box on a form.
They DON'T but click submit.
an alert box appears saying "Please enter your name"
and a red asterisk appears next to the empty box.

I was thinking perhaps putting a div tag around the asterisk with a given 
ID, and setting it's propertie to invisible, or perhaps the same colour as 
the background, then changing this once the submit button is clicked.

Would this work?  If so what would the code look like?

Thanks in advance!

cheers,

Alex

  Return to Index