Accountability Posted February 17, 2013 Report Share Posted February 17, 2013 I have two Java Scripts: ****************************************************************************************************************************************************** 1) function concatenate() { var position1 = document.getElementById("EditRecordLast_Name").value; var position2 = document.getElementById("EditRecordHOH_ID").value; var allpositions = position1 +" ID:" + position2; document.getElementById("EditRecordStudent_Last_Name_ID").value = allpositions; } document.getElementById("caspioform").onsubmit=concatenate; ****************************************************************************************************************************************************** 2) function f_submit() { document.getElementById("caspioform").submit(); } window.onload = f_submit; ****************************************************************************************************************************************************** I can put script (1) in an html block or footer and it works perfectly. But if I add the auto-submit sctipt (2) in the footer it makes script1 quit working. I need for script one to work with the auto-submit script. Is there a way to make them work together ? Thanks in advance for your assistance Quote Link to comment Share on other sites More sharing options...
ShWolf Posted February 19, 2013 Report Share Posted February 19, 2013 Hi, Script (1) quit working because Script (2) submit form in the moment when the form loaded, so the Script (1) doesn't have time to work Insert following script into the footer <SCRIPT LANGUAGE="JavaScript"> window.onload = function() { var position1 = document.getElementById("EditRecordLast_Name").value; var position2 = document.getElementById("EditRecordHOH_ID").value; var allpositions = position1 +" ID:" + position2; document.getElementById("EditRecordStudent_Last_Name_ID").value = allpositions; document.getElementById("caspioform").submit(); } </SCRIPT> Let me know if this helps. Quote Link to comment Share on other sites More sharing options...
Accountability Posted February 19, 2013 Author Report Share Posted February 19, 2013 Hello ShWolf, That worked brilliantly. THANK YOU THANK YOU THANK YOU !!! Please know how much you help is appreciated. With Kind Regards, Accountability Quote Link to comment Share on other sites More sharing options...
MayMusic Posted February 22, 2013 Report Share Posted February 22, 2013 I liked the way you described the issue THANK YOU 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.