![]() |
|
|
|||||||
| Javascript and Ajax Questions and information about working with Ajax and Javascript in Delphi for PHP. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I'm working through that myself.
The first part checks for text. The second part checks for the @ symbol. this will also color the box red if there is a problem or to let you know this field needs input and green to let you know its correct. I have this on the onBlur javascript event. I hope this helps. if (document.getElementById("email").value == "" || document.getElementById("email").value == "Required!") { findObj('email').style.backgroundColor= '#ffcaca'; document.getElementById("email").value = "Required!" } else if (document.getElementById("email").value.indexOf ('@', 0) == -1) { findObj('email').style.backgroundColor= '#ffcaca'; document.getElementById("email").value = "Not valid!" } else { findObj('email').style.backgroundColor= '#d0ffca'; |
|
|||
|
Thanks for that formula I will try it out.
I was going to check the form with an on click event on the server side (PHP)what I am doing right now is very much a work in progress I am still trying to get to grips with (PHP, JavaScript, XML, CSS) and how they all work together. ![]() The onblur event is really for the user not for error checking, kind of a visual feed back. This will all be setup as a function soon. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|