thebluestar 0 Junior Poster in Training
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">
	function sendto()
	{
		var Lname = document.myform.last.value;
		var Fname = document.myform.first.value;
		document.write("Hello!," + " " + Fname + Lname);
		var choice = confirm("Your name is true? OR press Cancel to re-enter");
		if(choice==true)
		{
			alert("OK");
		}
		else
		{
			window.location="thisFile.htm";
			//here I don't know how to Focus on the Lastname textfied
			//because after I press Send button , the whole page is reloaded
			document.myform.last.focus();
		}
	}
</script>
</head>

<body>
<form action="" method="get" name="myform">
	Last name:<input name="last" type="text" size="10" /><br/><br/>
	Firstname:<input name="first" type="text" size="10" /><br/>
	<input name="" type="button" value="Send" onClick="sendto()"/>
</form>
</body>
</html>

This requires after the user enter their name, press Sendto button, all information will be sended to or displayed in the new page.
Then,they confirm the name they entered is true if not it will come back the first page and the lastname field is focused!
Please help me!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.