Jump to content

JS concatenate a display only field and a cascading dropdown


Recommended Posts

i have a search and report type of form where it has a display only email field and a cascading dropdown email field. im going to concatenate both emails so everytime i update the form, it will automatically send notification to both email addresses. this is my current script:

function concatenate()

{

var e1 = document.getElementById("EditRecordEMAIL").value;

var e2 = document.getElementByName("EditRecordALLOCATED_EMAIL")[0].value;

var com_email = e1 + ";" + e2;

document.getElementById("cbParamVirtual1").value = com_email;

var allpositions= document.getElementById("cbParamVirtual1").value;

alert('all email='+ com_email);

alert('all email='+ allpositions);

}

document.getElementById("caspioform").onsubmit=concatenate;

i was told by support team that my display only field needs to be changed into text field in order to use getElementById, so ive changed it and yet it still not working

the problem is the script is not working at all,

is there anyone who would help ?

thanks in advance

Link to comment
Share on other sites

okey so i tried some fixing, and the first EMAIL field is changed into text field and email elements and so far its still working with the following script:

function concatenate()

{

var e1 = document.getElementById("EditRecordEMAIL").value;

var e2 = document.getElementsByName("EditRecordALLOCATED_EMAIL")[0].value;

var com_email = e1 + ";" + e2;

alert(com_email);

document.getElementById("cbParamVirtual1").value = com_email;

var allpositions= document.getElementById("cbParamVirtual1").value;

}

document.getElementById("caspioform").onsubmit=concatenate;

but is there any possibility to obtain the value from a display only field ?

i dont want to have the first mail field as text field / email / hidden

Link to comment
Share on other sites

One more idea :)

Change your first email field to 'Display Only'.

Now insert on Details page Virtual field, select 'Hidden' form element and in 'Advanced' tab enable 'Receive parameter'. Insert [@field:EMAIL] as parameter.

Now just change:

var e1 = document.getElementById("EditRecordEMAIL").value;
on:

var e1 = document.getElementById("cbParamVirtual2").value;

Let me know if this helps.

Link to comment
Share on other sites

nice !! yours works as expected,

i also make another alternative (perhaps similar)

function concatenate()

{

var e1 = document.getElementById("EditRecordEMAIL").value;

var e2 = document.getElementsByName("EditRecordALLOCATED_EMAIL")[0].value;

var com_email = e1 + ";" + e2;

alert(com_email);

document.getElementById("cbParamVirtual1").value = com_email;

var allpositions= document.getElementById("cbParamVirtual1").value;

}

document.getElementById("caspioform").onsubmit=concatenate;

thanks for dropping by wolf

Link to comment
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
Reply to this topic...

×   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...