Jump to content
  • 0

Have City Parameter Passed Into Form - Need Email Group Created Per City


Go to solution Solved by geoffdude,

Question

Hello,

 

I have 10 different pages (city chambers) that each use the same base caspio form.

 

Once the page is loaded, it passes the city name into the caspio form via javascript. The caspio form has a field (chamber) that captures the variable city name, then populates 2 cascading text form fields each with a variable email address. (email1 & email2).

 

I then want to concat email1 value and email2 value into text field emailgroup to create a mailing list.

 

It's not working.

 

Form fields are:

 

chamber = catches external parameter of city name (there are 10 variable city names)

email1 = value is auto determined my city name captured from table data chamber filter (cascading text field)

email2 = value is also determined my city name captured from table data chamber filter (cascading text field)

emailgroup = text field I want to concatenate the email1 and email2 values into to create an email group to send email notice to on form submission.

 

I've tried all the examples here, but can't get it to work. See concat script below I've been working with.

 

Any help is appreciated.

 

Thx

 

Geoff

<SCRIPT LANGUAGE="JavaScript">

function concatenate()
{
var position1 = document.getElementsByName("InsertRecordemail1".value)[0];
var position1 = document.getElementsByName("InsertRecordemail2".value)[0];

var allpositions = position1 + position2;

document.getElementById("InsertRecordemailgroup").value = allpositions;

}

document.getElementById("caspioform").onsubmit=concatenate;
</SCRIPT> 
Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
  • Solution

I actually got it working... though it was a bit of work.

 

The script had the [0] after ".value" and it needed to go before it. See example below.

<SCRIPT LANGUAGE="JavaScript">

function concatenate()
{
var position1 = document.getElementsByName("InsertRecordemail1")[0].value;
var position2 = document.getElementsByName("InsertRecordemail2")[0].value;

var allpositions = position1 +";"+ position2+";";

document.getElementById("InsertRecordemailgroup").value = allpositions;

}

document.getElementById("caspioform").onsubmit=concatenate;
</SCRIPT>
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...