Wgdm8 Posted November 15, 2015 Report Share Posted November 15, 2015 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> Quote Link to comment Share on other sites More sharing options...
Aurora Posted November 18, 2015 Report Share Posted November 18, 2015 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 Quote Link to comment Share on other sites More sharing options...
Wgdm8 Posted November 19, 2015 Author Report Share Posted November 19, 2015 Yes, thank you. I don't understand it, but it works just as I had wanted when I paste in your code directly replacing what I had previously. There were several forms on the web page, but only the one update page. 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.