Jump to content

Validation Messages


Chikwado
 Share

Recommended Posts

Some one check this: I made the following code to validate "Username" which work fine.

[color=green]<html>[/color]
<body>
<script>
function ValidateForm() {
var x = document.forms["myForm"] ["fname"].value; if(x == " ") || (x == " ") { alert("Please Input Your Name!"); return false; } } [/code ] That is: If the input is correct it will accept it but if the input is incorrect it will reject. How to modify that code so that when the input is incorrect it will say, "Your Input Is Incorrect" and when the input is correct, it will say: "You have succefully registered with us as "Username". some one check it. Edited by Chikwado
Link to comment
Share on other sites

what have you tried? What specifically are you having trouble with? I curious though, because If that is indeed your original code, then surely it should be a trival change to change to alter the output text and add an else conditional. At the very least, present what you've tried, we're not going to do it for you.

 

Also, please use code tags when posting code. At the very least, separate it from the body of your post.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...