Question

Locked

Hidden Values <== Javascript Return Values

By parani.raj ·
Hi

Can you please go through the HTML files and let me know where am I going wrong?

Page1.html :
<html>
<head>
<title>PAGE 1</title>
</head>
<body>
<form action="page2.html" method="get" name="LoginForm" id="LoginForm">


Username : <input name="username" size="20">

Password :<input name="password" type=password size="20">

<input type="submit" name="Login" value="Login" >
<input type="reset" name="Reset2" value="Reset">

</form>
</body>
</html>

Page2.html :

<html>
<head>
<title> Page2.html </title>
<script type="text/javascript">
function GetParam(rname)
{

var rstart=location.search.indexOf("?"+rname+"=");
if (rstart<0) rstart=location.search.indexOf("&"+rname+"=");
if (rstart<0) return ' ';
rstart += rname.length+2;
var end=location.search.indexOf("&",rstart)-1;
if (end<0) { end=location.search.length; }
var result='';
for(var i=rstart;i<=end;i++)
{
var c=location.search.charAt(i);
result=result+(c=='+'?' ':c);
}

return unescape(result);

}
</script>
</head>
<body>
<form name="page2" method=get action="page3.html">
<input type="hidden" name="uname" value=GetParam(username)>

<input type="button" name="button" value="click">
</form>
</body>
</html>

When I tried to invoke GetParam(Username) javascript function, it didnt get the hidden element "UNAME" value instead it returned "GetParam(username)" itself.Can you put your ideas into this?


In Page3.html, I should be able to get the Hidden Values and Name for INPUT "UNAME"


Regards
Parani.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums