Hi everyone!
I am tyring to design two pages with Jscript and HTML.It's is really simple but I have problem:)
on first page,you write your first name and family and by you clicking on submit button you will be directed to another web page that Welcome you.
I konw I should use querystring.
This code is for first page.
<!DOCTYPE html>
<html>
<body>
<form id="frm1" action="HW1.html" method="post" target="_blank">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="Submit" value="Enter">
</form>
<script>
document.write(document.getElementById("frm1").method);
</script>
<p>Click to see welcome message</p>
</body>
</html>
I try this for something like this for the second one.(HW1.html)
<!DOCTYPE html>
<html>
<head>
<script>
function welcome(fname,lname)
{
alert("Welcome " +fname +" " +lname);
}
</script>
<script>
function func()
{
var fname= Request.QueryString("fname");
var lname= Request.QueryString("lname");
welcome(a,b);
}
</script>
</head>
<body>
alert(func());
</body>
</html>
It's better if I don't use alert.
and another try:
<script>
document.write("<p> welcome <%=Request.QueryString("fname")%>.
<%= Request.QueryString("lname")%> </p>");
</script>
<script type="text/javascript">
alert('Welcome <%=Request.QueryString("fname")%> <%= Request.QueryString("lname")%>');
</script>
anyway I really don't know how to show the names in second page correctly...