Jump to content

Concatenate In Update Form


Recommended Posts

I see many JS examples, but none addressing multiple datapages on the same webpage.  I have two text variables that I want to concatenate in the 3rd datapage on my update webpage.  I'm using the code attached in the footer of the detail page to no avail.  I've tried several alternatives on the last line but none worked.  The error associated with the last line below is "Object doesn't support property or method 'getElementById'.

<SCRIPT LANGUAGE="JavaScript">

function concatenate()
{

var temp11 = document.getElementById("EditRecordWhere_Sa").value;
var temp12 = document.getElementById("EditRecordWhere_Su").value;

var temp10 = temp11 + temp12;

document.getElementById("EditRecordWhere_Text").value = temp10;

}

document.forms[2].getElementById("Mod0EditRecord").onmouseover=concatenate;

</SCRIPT>
Link to comment
Share on other sites

Hello Wgdm8.

 

How many Update Forms do you have one web page? 

 

The last line of your script doesn't look correct. 

 

If you have only one Update Form,  you could use the following Script : 

 

<SCRIPT LANGUAGE="JavaScript">
 
function concatenate()
{
 
var temp11 = document.getElementById("EditRecordWhere_Sa").value;
var temp12 = document.getElementById("EditRecordWhere_Su").value;
 
var temp10 = temp11 + temp12;
 
document.getElementById("EditRecordWhere_Text").value = temp10;
 
}
 
 
var v_btn = document.getElementById("Mod0EditRecord");
        if(v_btn.addEventListener){
v_btn.addEventListener('mouseover', concatenate);
}else if(v_btn.attachEvent){
v_btn.attachEvent('onmouseover', concatenate);
}else{
var prevEvt = v_btn.onmouseover
v_btn.onmouseover= function(){
concatenate();
prevEvt && prevEvt();
};
}
 
</SCRIPT>


Please let me know if it helps.
 
Aurora
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...