78
rated 0 times
[
81]
[
3]
/ answers: 1 / hits: 14756
/ 11 Years ago, fri, december 13, 2013, 12:00:00
So I want to create a prompt that asks for a clients name. I want to make sure it is formatted in this way: Last name, first name, middle initial and no name longer than 20 characters.
Here is what I have so far, but not sure where to go from here.
<script language=JavaScript>
//Get the name
var name = prompt(What is your Name?);
//validate
if(name)
//output
document.write (That is your name! :));
else
document.write (Please use the format Last name, first name, middle initial);
</script>
More From » html