Alyssa K 25.Feb.03 05:28 PM a Web browser - Category - 2.0.8Windows NT
Hi everyone,
I'm trying to focus the h_Name field when the page loads for the first time (not published). This should be very simple and easy. The focus part works however the cancel and publish buttons dont work anymore when this portion of the script is enabled.
Is it true focus will not work when there are diabled fields?
Below is my code.
// Onload (open) JavaScript procedures.
function QDK_HTMLForm_OnLoadHandlerCallback(theForm)
{
var myform = document.forms[0];
if(h_IsNewDoc!=0)// If it is a new doc add today's date as default.
{
document.forms[0].h_CalendarDate.value = datechoice;
myForm.h_Name.focus();
}
if (h_IsNewDoc==0) // If it is not a new document, disable fields.
{
document.forms[0].h_Name.disabled = true;
document.forms[0].c_DocNo.disabled = true;
document.forms[0].h_CalendarDate.disabled = true;
document.forms[0].c_DocDescription.disabled = true;
}
}
</SCRIPT>
If you can help please post a response.
I've also tried this and it doesn't work either.
document.forms[0].h_Name.focus();
I have many other javascript bit's a pieces related to this html form. Could this be the problem. Is there anything that i should watch out for?