radityatirta Posted March 19, 2012 Report Share Posted March 19, 2012 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 Quote Link to comment Share on other sites More sharing options...
radityatirta Posted March 20, 2012 Author Report Share Posted March 20, 2012 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 Quote Link to comment Share on other sites More sharing options...
ShWolf Posted March 22, 2012 Report Share Posted March 22, 2012 Hi, On the Details page display only fields don't have id's and names. You can try to find value in display only field using xPath (use for example FireBug to inspect elements on page and find correct xPath to the with email value). Quote Link to comment Share on other sites More sharing options...
ShWolf Posted March 22, 2012 Report Share Posted March 22, 2012 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. Quote Link to comment Share on other sites More sharing options...
radityatirta Posted March 26, 2012 Author Report Share Posted March 26, 2012 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.