Jump to content

Concatenate Cascading and a non-cascading field


Recommended Posts

Hi,

 

I've played with this for a couple hours now and can't seem to get it to work. I am receiving a parameter PROJECTID and trying to combine it with a field from a cascading auto complete text field USERID. Both fields are numerical fields.

 

<SCRIPT LANGUAGE="JavaScript">

function concatenate()
{
var x1 = document.getElementByName("InsertRecorduserid")[0].value;
var x2 = document.getElementById("InsertRecordprojectid").value;

var projectiduserid = x1 + x2;

document.getElementById("InsertRecordprojectiduserid").value = projectiduserid;

}

document.getElementById("caspioform").onsubmit=concatenate;
</SCRIPT>

 

Any ideas what I'm missing?

Thanks,

Mark

Link to comment
Share on other sites

I figured it out!

 

Should have been getElements vs getElement for cascading field.

 

<SCRIPT LANGUAGE="JavaScript">

function concatenate() 

var x1 = document.getElementById("InsertRecordprojectid").value;

var x2 = document.getElementsByName("InsertRecorduserid")[0].value;

 

 

 

 

document.getElementById("InsertRecordprojectiduserid").value = x1+x2;

 

 

document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT>

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

×
×
  • Create New...