Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


What's wrong with this script?



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
jrolinson



Joined: 24 Mar 2008
Posts: 1

PostPosted: Mon Mar 24, 2008 12:07 pm    Post subject: What's wrong with this script? Reply with quote

Trying to get some script working that simply gets user input, checks if that input string has already been used and either tells the user or continues. For now, the script has a fair few test window alerts, but I can't see why it's not working. Can anyone help?

<html>
<head>
<script language="JavaScript">
function MakeNewClient()
{
window.alert("test1");
NewClientName = window.prompt("Please enter client name","");
NameExists = false;
if ((NewClientName != null) && (NewClientName != ""))
{
for (count = 0; count < document.forms[0].AdminClient.length; count++)
{
If (document.forms[0].AdminClient.options[count].text == NewClientName)
{
NameExists = true;
}
window.alert(document.forms[0].AdminClient.options[count].text);
}
If (NameExists == true)
{
window.alert("That client name already exists. Please choose another.");
}
else
{
window.alert("TEMP continue with new client creation");
}
window.alert("test2");
}
window.alert("test3");
}
</script>
</head>
<body>
<form>
<P>
<Select Name="AdminClient">
<OPTION>Client 1
<OPTION>Client 2
<OPTION>Client 3
</SELECT></P>
<input name = btn type=button value="Some text" onClick="MakeNewClient()">
</form>
</body>
</html>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap