Abort client script onsubmit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 02:41 PM
Hi there,
i have the following script include:
and i have the following client script:
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 03:03 PM
for some reason its not working its alwasy letting me submit the form even if its empty the answer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 03:05 PM
Can you alert(answer) and check what the value is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 03:08 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 03:19 PM
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;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 03:27 PM
it doesnt work my friend ;(