473,568 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending Variable content, not Variable name

Here's what I'm trying to do:

I have a large number of pages that call a pop-up survey page. It is
important to know what page the survey is referring to - so I am
passing the name of the referring page through the URL.

The problem I'm having is that when the data on the survey page is
submitted through formmail, I can't seem to get the referring page's
name sent too - I keep getting the variable name itself, not the
contents of the variable.

So for instance, if the referring page is 123.htm, and I assign it to
variable "external_u rl", I get the name "external_u rl" sent through
formmail, not the contents of the variable.

HELP.

Here's the script I'm using to on the popup survey page (or at least
the part to parse out the referring page's name).

<Script LANGUAGE="javas cript">
external_url = window.location .search.substri ng(1);
</script>

Amongst my input fields for formmail I presume I would include:

<input type="hidden" name="subject" value="external _url">

But this doesn't work.

I haven't bothered to include the rest of the form code - but it is
working fine (ie I get the mail results back, its just that "subject"
comes back as "external_u rl" instead of the referring page's name.

Also, I know that "external_u rl" is working because I have a
document.write( external_url); in the document to ensure that the
variable is working and containing the correct info displayed on the
screen.

I figure this is a simple issue - but I can't figure it out. Thanks
in advance.

Jul 23 '05 #1
2 1463
"Ian Hubling" <ia*@hubling.co m> wrote:
<Script LANGUAGE="javas cript">
external_url = window.location .search.substri ng(1);
</script>
Amongst my input fields for formmail I presume I would include:
<input type="hidden" name="subject" value="external _url">


You can't just include variable names and expect javascript to interpret
them. Instead, you should have javascript write out the hidden input itself,
like this:

document.write( '<input type="hidden" name="subject" value="' + external_url
+ '">');

Your document will then contain a hdiden input with the correct value.

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/
Jul 23 '05 #2


Thanks a million Matt - I had to play around with it - but I understood
what you were saying and managed to get it to work.

This will save a lot of work and coding in the long run. Again - thanks
for the help.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7031
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt. Obviuosly, the file is fine on the server, so the attachment code I am using must be corrupting it, but I dont know what it is: // send email with...
6
6737
by: Hansan | last post by:
Hi all. I am working on a webpage where I use python and html. When I want to send one variable to a new script/page I use the following code: 0) print '''<input type=hidden name="eventid" value='''+str(variable_name)+'''>''' This works fine, the problem occurs when I want to send a variable to a page
2
1632
by: Marcelo | last post by:
Hi guys, I'm using the following code to send values from one page to another, but seems to me, that the event Page_Load in the receiving page never fires. Why? This is the code: Thanks -*-*-*-*-*-*
5
3016
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I need to send data from my server via the post method to the payment server. The payment server does not run asp.net. I dont know what they run. The...
4
3121
by: splicemix | last post by:
Hi all, I have recently set up a Drupal website. I am a beginner. My shared host server does not allow nobody@localhost to send emails, and prevents access to php.ini, so I spent some time getting a SMTP script running. While the Drupal feedback module and the new account creation works fine in terms of sending of mails, I am having some...
6
2728
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
7
3322
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of guests added. form.php function createGuestNameAndEmailElements() {
2
3738
by: lstanikmas | last post by:
Hi, I'm validating a form with this ASP but receiving some blank email responses; does anyone see anything wrong with it?: function isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars = thisForm.elements.value; var arrExcludeVars = strExcludeVars.split(","); for (var j=0; j<arrExcludeVars.length; j++) { if (arrExcludeVars ==...
0
2228
by: vigneshrao | last post by:
Hi, I have been working on a script that loops through multiple records and sends data (one record per call) to a WS. I am supposed to make a new call for each record before sending the data. The problem I have is the first record gets processed fine where as the second record always; reason being the EAI expects it to be a seperate call...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.