Hello,
I have a JavaScript that asks for the user name, if the field is empty it does not let the user get in, if the user fills out his/her name it let's them in to the Form.
I have a script that is supposed to pass the username to a field in my form. Not sure what i am doing wrong because it is not passing the username.
here is what I have so far
I have a JavaScript that asks for the user name, if the field is empty it does not let the user get in, if the user fills out his/her name it let's them in to the Form.
I have a script that is supposed to pass the username to a field in my form. Not sure what i am doing wrong because it is not passing the username.
here is what I have so far
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="JavaScript">
temp= window.prompt ("Please Type Your Name" , "");
if (temp=="") { window.location="[URL unfurl="true"]http://wrongpage.htm";}[/URL]
</script>
<script>
function initialize()
{
document.forms['form'].elements['username'].value = temp ;
}
</script>
</head>
<body>
<form name="form" method="post" action="update_entry00.asp">
<input name="category" type="text" value="Category1" />
<input name="questionid" type="text" value="1" />
<input name="questions" type="text" value="What color do you like?" />
<input name="answer" type="text" value="" />
<input name="username" type="text" value="<% = Response.Write(Request.QueryString("temp"))%>" readonly="true" />
<p>
<input type="submit" name="Submit" value="submit"></p>
</form>
</body>
</html>