/    Sign up×
Community /Pin to ProfileBookmark

Need help passing loaded form variable in URL

Hey Guys….

I have a form that uses javascript that grabs variables from the URL. The variables are then loaded into a database from hidden fields the submission of the form.

I also need to pass these same variables in a URL for a new window from a link on the page.

Can someone assist me on how to do this?

To clarify…I need to include the variables I grabbed from the URL into a new link on the page.

Thanks!

to post a comment
JavaScript

11 Comments(s)

Copy linkTweet thisAlerts:
@knipperauthorMay 30.2003 — To clarify a little more...

I am using several scripts on this page to do different things.

Primarily I pass variables in a url. I use one script to grab the variable.

Another script loads the variables into hidden form fields, which gets passed into a database.

The last script is to open a new window and submit the form. This is where I have the problem.


I can create a text link URL that grabs the loaded variables and writes the URL, but it won't work in the pop-up window.

Here's an example:

I can pass the variable in a text link like this:

<snip> code made window too long

But I need to get the URL to write in a window pop-up script that looks like this:

<snip> code made window too long

Help! ?
Copy linkTweet thisAlerts:
@knipperauthorMay 31.2003 — Thanks Dave,

Thats the general idea, but I can't do it that way. I'm using a program called "phorm" to process the form.

Phorm actually controls the results... In my case it sends the info to a database, gives the customer a thank you for submitting page, and also e-mails the results to an e-mail box.

I'm trying to actually have two submit buttons, one that submits the form without the pop-up box, and one that submits the form and creates the pop-up box, passing some of the already gathered variables into the url of the popup.

I am almost there.... everything works EXCEPT the passing of the variable through to the popup box URL.

I can use one submit button to submit normally... works fine.(feeds database, shows page, and e-mails)

I can use the other submit button to a normal URL, works fine. (Pops up new window, shows thanks page, writes to the database, and e-mails)

BUT... I need to pass some of the variables through to the URL of the popup box.

If I can do this using some of the code you showed can you clarify? I can usually tweak code to make it do what I want, but don't know enough to write it myself. I know just enough to be dangerous! ?
Copy linkTweet thisAlerts:
@knipperauthorMay 31.2003 — Thanks again Dave,

I'll give that a shot in the AM. Time to end the day. 17 hours is plenty! ?
Copy linkTweet thisAlerts:
@knipperauthorJun 02.2003 — Hey again Dave,

I still can't get the variables to pass. If you could take a look and send some additional suggestions I'd appreciate it. ?

OOoopppsss... You don't allow e-mail through the forum.

Take a look at [URL=http://www.steveknipschild.com/phorm/javatest/survey2.htm?cust=DR00000001&invoice=123456&store=000&date=2003-06-02&salesperson=04&cashier=04]this form[/URL] to see the whole picture.
Copy linkTweet thisAlerts:
@Khalid_AliJun 02.2003 — Do you mean you want to pass form values to another page using URL?

If so..take alooksy at this link..

http://68.145.35.86/skills/javascripts/DemoForwardFormDataViaURL.html

It might help
Copy linkTweet thisAlerts:
@knipperauthorJun 02.2003 — Khalid,

Thats exactly what I need to do on the "first submit button" from my form. Take a look at the link I posted above and you'll see what I'm trying to do. ?

Can you shed some light on how to accomplish this?
Copy linkTweet thisAlerts:
@Khalid_AliJun 02.2003 — Sorry,but can you clearly describe what is it you need..if you want to pass a variable to a popup(a child) window,then there is a better way for doing this.you can use direct communication ..take a look at this link.

http://68.145.35.86/skills/javascripts/ParentWinInteractionWithChildWin.html
Copy linkTweet thisAlerts:
@knipperauthorJun 02.2003 — Khalid,

I'll explain my whole scenario here:

1) I send a cust an e-mail to have them fill out my form. The link contains variables passed in the URL containing several items.

2) These variables get loaded into a single form which I need to offer two different types of submissions. (two different buttons)

3) Either submission passes the variables and other form data to a database, show the customer a thank you page, and e-mail the info.

PROBLEM: The first button uses javascript to open a new window in which I need to pass these same variables as before. It does already perform the same thing as step 2 above... I just can't get the variables to pass in the URL for the pop-up window.

If you view the source of the URL I posted before you will see how I have configured it to now.
Copy linkTweet thisAlerts:
@Khalid_AliJun 02.2003 — I guess if you insit on passing values using url to poup (first button ??)

then you will need to make changes in this function

function Start(page) {

OpenWin = this.open(page, "CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=660 height=300");

}

you will need to apend all of the variables with the link which is

page (parameter passed to Start function

You will need something like this to be done

page = page+"?variableName"+variable+"&variable2Name="+variable2;

and you can add several values just like that

make sure you have "?" mark right after the actual url and then you apend "&" to seaparate each variable value
Copy linkTweet thisAlerts:
@knipperauthorJun 02.2003 — Ahhhh Hhhaaa!! That looks like it worked!

I'm sure there is probably a better way, but this thing (project) got cobbled together with input from several people after the initial form was created.

I'll post again if I have any other problems. Thanks to both you Khalid Ali and Dave Clark for your help and input.

Your assistance is invaluable! ?
Copy linkTweet thisAlerts:
@Khalid_AliJun 02.2003 — hey u are welcome..?
×

Success!

Help @knipper spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...