Hi all,I have a problem.I have a Login Form on the Web.I am validating the username and password and if it verifies then I want to transfer the person to a new Form which has all details.
Now the problem is that I want a message “Hello ” to be displayed on the top of the page.
I tried using Environment Variables but its not giving the desired output.
Any help would be greatly appreciated.
Thanks in advance
Subject: How to pass values from one form to another in Web??
Hi Khushi,
Try Javascript!
With your first form open on the screen:
(temp variable to store username) = document.forms[0].(username field on first form).value;
Open your second form*, then:
document.forms[0].(username field on second form).value = (temp variable to store username); (or set the field = “Hello” + temp variable;)
OR
alert( "Hello " + (temp variable to store username) + “.” );
HTH,
Paul.
var target;
target = (target == null ) ? window : target ;
url = “http://(page to open)”;
target.location.href = url;
Subject: RE: How to pass values from one form to another in Web??
Hi Paul .Thanks for the prompt help.This is what i was trying to do also
but my problem is not getting solved…
this is the code i’d written
MainForm
var name_val;
function passval()
{
name_val=document.forms[0].name_person.value;
location.href="Second Form?OpenForm"
}
I m calling this on the Button Click event.
Second Form :(in the On Load event)
document.forms[0].derived_name.value =name_val;
Am i missing something???
Please do help.
Subject: Scope of name_val is lost when new page loads.
You can try using adding a query_string to the form being called and passing it that way.
location.href=“Second Form?OpenForm&Name=John”
Then parse that out of the href on the new page load.
Subject: Thanks a Lot!!!Passing Parameters in URL worked
I did it.It required a combination of Javascript and @Formula.
I sent the Login Name as a parameter to the JS function which opened a new page in case the Login Name is verified.This JS Function once again passes the Login Name as a parameter in the URL.
Then in the Second Form I used the Query_String_Decoded field to get the URL string and then retrived the Login Name from it using @Middle.
Its easy and it worked.If someone has a better and easier way to do it then pls do tell me.For the time being this works.
Thanks a lot all of you for ur inputs!!!It was greatly appreciated by this GreenHorn!! ;-))
Thanks Once again.
Subject: Look into @UrlQueryString function too…
Subject: RE: Scope of name_val is lost when new page loads.
Cookies are another possibility, provided that the apparent domain doesn’t change.
Subject: How to pass values from one form to another in Web??
You don’t need to pass values. Once the user is logged in, you can use computed text on the new form with the formula:
"Hello, "+@Name([CN]; @UserName)
and it should work just fine.
Subject: RE: How to pass values from one form to another in Web??
No I cant do that as i am allowing the User to create his own Username for a system.So @UserName cannot be used.