Abort client script onsubmit

Mr Bow
Kilo Expert

Hi there,

i have the following script include:

 

 

find_real_file.png

 

and i have the following client script: 

find_real_file.png

What i want is that if my  script include return empty the client script abort and if its not empty the client script let the user submit the form. right now its working fine the include but there is something wrong with my client script as its always aborting with the line 13 in my code. any ideas?

 

12 REPLIES 12

for some reason its not working its alwasy letting me submit the form even if its empty the answer

Can you alert(answer) and check what the value is?

find_real_file.png

its empty so it should return false meaning abort the submission

Try putting it into a variable then the if statement will check if the variable is null or not.

 

function Process(response) {
		var answer = response.responseXML.documentElement.getAttribute("answer");
		var returnedAnswer = answer.toString();
                if (returnedAnswer){
			return false;
		}
                else{
		return true;
                }
	}

it doesnt work my friend ;(