I want to call two functions on submit
onsubmit="retur n checkTitle(this ,'<? echo $language?>');s etOfferCookies( )"
but it doesnt even call the first function
[code=javascript]
function checkTitle(form ,language){
alert("checkTit le");<----to check if it works
if(form.title.v alue.length==0 || form.title.valu e=="***Proszę wpisać tytuł!" || form.title.valu e=="***Please enter the title!" ){
document.getEle mentById("title ").style.color= "red";
if(language=="p olish"){
form.title.valu e="***Proszę wpisać tytuł!";}
else {form.title.val ue="***Please enter the title!";}
return false;
}else {document.getEl ementById("titl e").style.color ="black";}
return true;
}
[/code]
thank You
onsubmit="retur n checkTitle(this ,'<? echo $language?>');s etOfferCookies( )"
but it doesnt even call the first function
[code=javascript]
function checkTitle(form ,language){
alert("checkTit le");<----to check if it works
if(form.title.v alue.length==0 || form.title.valu e=="***Proszę wpisać tytuł!" || form.title.valu e=="***Please enter the title!" ){
document.getEle mentById("title ").style.color= "red";
if(language=="p olish"){
form.title.valu e="***Proszę wpisać tytuł!";}
else {form.title.val ue="***Please enter the title!";}
return false;
}else {document.getEl ementById("titl e").style.color ="black";}
return true;
}
[/code]
thank You
Comment