Hi guys,
I have query related onlick event when the submit button is disabled.
I am calling a function on onclick event which disbables the button for two mins and is enabled ( i have setTimeout). the funtion returns true value however on retun true the set value will set the ip
here is the part of code snippet:
In the below snippet, if i uncomment the comment line, commenting the below line, it just wokrks fine doing the setting of the ip values. How ever using the function where i actually disable the button and return the function value and timeout after sometime to enable the button works fine but the return value to set the ip vaues doesnt happen. it fails to set the values when disabled. Its bit tricky. let me know if any other ways i can try to do or any suggestions to do.
stuff = "<form name=APPLIC action=item.php method=POST target=_self>";
stuff += "<input type=hidden name=SET value=LEAF>";
stuff += "<input type=hidden name=3421 " value=-2718445 >";
if (model == XL)
{
// stuff += "<input type=submit value=\"set \" onclick=\"return true;\">";
stuff += "<input type=submit id=submit_id value=\"set ip\" onclick=\"return do-set();\">";
setTimeout("document.getElementById('submit_id').disabled=false", 12000);
}
stuff += "</form>";
writeSingleTableRow(stuff, "");
}
}
writeBodyTail();
function do-set()
{
var update;
update = confirm('please wwait for some time...?');
if(update)
{
document.getElementById('submit_id').disabled = 'true';
alert(update);
return update;
}
else
return false;
}
</SCRIPT>
</HTML>