Web Development



Hidden Values <== Javascript Return Values

By parani.raj ·

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

Page1.html :
<title>PAGE 1</title>
<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">


Page2.html :

<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);

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

<input type="button" name="button" value="click">

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"


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Related Discussions

Related Forums