MichaelMcDonald
Posts: 640
|
Posted: 10/15/2012, 2:14 AM |
|
I have the following script working on a form that form is not in edit mode...
<script language="JavaScript">
var start=new Date();
start=Date.parse(start)/1000;
var counts=100;
function countDown(){
var now=new Date();
now=Date.parse(now)/1000;
var x=parseInt(counts-(now-start),10);
if(document.recordWorkorder){document.recordWorkorder.recipient.value = x;}
if(x>0){
timerID=setTimeout("countDown()", 100)
}
}
window.setTimeout('countDown()',100);
</script>
Problem is that When I add the script to the onclick (client side) of a button on a form in editmode, this same script does not work. I have also tried placing the script in the forms onload client side to test and it doesnt work there either.
_________________
Central Coast, NSW, Australia.
|
|
|
DataDoIT
|
Posted: 10/15/2012, 6:21 AM |
|
Debugging client-side javascript is very easy nowadays with the built-in
browser developer tools. Learn them and use them often. They'll tell
you exactly where your issues are.
Ex: In Chrome, load your page, then hit Ctrl-Shift-I. If there are
javascript errors it'll tell you exactly where and why.
|
|
|
|