I have a mass modification form element (date picker) with the following code in the HTML Form Element Attributes box:
onChange="if( isDate3(this.value)==false){ this.value=''};"
The function being called is (Which is in the HTML Header text area of the HTML Header and Body Attribute section):
function isDate3(givenDate){
//alert(givenDate)
//Check to see if the givenDate is not null before checking
//the date format.
if (givenDate != '') {
if (getDateFromFormat(givenDate, 'MM/DD/YYYY')==0 ){
alert("Please enter a valid date in the format: MM/DD/YYYY");
return false;
}
}
return true;
}
However, when I change the value of the date picker, to "test" for example, no alert is given.
I added the code:
function sayhello()
{
alert("Say Hello");
return true;
}
and changed the call to:
onchange="sayhello();"
and it worked fine.
Anything wrong with my code to cause the first function not to work?
I have other code that doesn't seem to work as well:
function setColor()
{
var obj = document.getElementById("SUBMIT");
obj.style.backgroundColor="yellow";
}
This call is in the Element Attribute text box for the Tabular Form Element. When changed it is supposed to highlight my SUBMIT button which has a "Button Name" of SUBMIT:
onFocus="savedData=this.value;" onChange="if(isDate3(this.value)==false){this.value=savedData} else if (savedData != this.value){setColor()};"
Thanks
Steven