theconav Posted May 19, 2013 Report Share Posted May 19, 2013 Hello everyone. I have the following scripts in a details page footer : function Displayer(n) { var check=document.getElementById('Section'+n); if(check.style.display=='none') { check.style.display='inline'; } else { check.style.display='none'; } } function assignauditcodes() { var position1 = document.getElementsByName("EditRecordGSP_Code")[0].value; var position2 = document.getElementsByName("EditRecordAuditing_Location")[0].value; var allpositions = position1+"-"+position2; var position3 = document.getElementsByName("EditRecordGSP_Code")[0].value; var position4 = document.getElementsByName("EditRecordAppointed_AE_Code3")[0].value; var position5 = document.getElementsByName("EditRecordAuditing_Location")[0].value; var position6 = document.getElementById("EditRecordAudit_Category").value; var position7 = document.getElementsByName("EditRecordAudit_Schedule")[0].value; var position8 = position7.substr(6,4) ; var allpositions2 = "ISAGO"+"-"+position3+"-"+position4+"-"+position5+"-"+position6+"-"+position8; document.getElementById("EditRecordAudit_Code").value = allpositions; document.getElementById("EditRecordAudit_Allocation_Code").value = allpositions2; } document.getElementById("caspioform").onsubmit=assignauditcodes; var setCurrentStatus = function(status) { document.getElementsByName('EditRecordAudit_Current_Status')[0].value = status; } document.getElementById('caspioform').onsubmit = function() { var appointedAE = document.getElementsByName('EditRecordAppointed_AE_Code')[0].value; var closeDate = document.getElementById('EditRecordAudit_Closing_Date').value; var today = new Date(); today.setHours(0,0,0,0); if(appointedAE == '-None-') { setCurrentStatus('1-New'); } else if(closeDate == '') { setCurrentStatus('2-Assigned'); } else { closeDate = new Date(closeDate); closeDate.setHours(0,0,0,0); if(closeDate > today) { setCurrentStatus('3-Scheduled'); } else { setCurrentStatus('4-Performed'); } } } When updating the record the assignauditcodes() function doesn't seem to work. However, if i remove completely the last script (var current status ….) it works perfectly. I assume that there is something wrong, when both these scripts appear together. Could anyone advise what might be wrong ? Thank you very much Quote Link to comment Share on other sites More sharing options...
theconav Posted June 7, 2013 Author Report Share Posted June 7, 2013 Any help on this please ? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 10, 2013 Report Share Posted June 10, 2013 Check and see what error you are getting when the page loads using developer tools such as firebug, https://getfirebug.com/. Also you can try to combine the scripts to only have have one script tag. Usually when we have more then one script there will be some issues. 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.