Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

Getting a just Entered field to a JavaScript Variable after pressing Save

$
0
0
Hi,

I'm looking for a cleaner method to do this:

I have a user table with firstname, lastname and email

I'm on the user Add Screen and I enter the data. When I press "SAVE" I use the Custom Add Event to grab the email and put it in a SESSION variable, then I jump to a dummy Table ADD EVENT.

Code in CustomAdd

$_SESSION["email"=$values["email"];
header("Location: dummy_add.php");
exit()

At the Dummy Table ADD Page Event I can use the Proxy commands with the Javascript onload Event

In Before Display:

$pageObject->setProxyValue("email", $_SESSION["email"]);

In Javascript onload Event

var email=proxy["email"];

Now I can process the email Javascript Variable as needed and then I jump to where I want to really go before the dummy Page Appears.

header("Location: ..._list.php");
exit()

I got all of the above to work but it's sloppy having to setup a Dummy Table to do this. Can anyone suggest a cleaner way to send the newly added email field to Javascript for processing without having to setup a Dummy Table.

-Steve

Viewing all articles
Browse latest Browse all 2586

Trending Articles