<div dir="ltr">Just as an addition try to return a value as well (true or false based on the validation).</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 4, 2018 at 9:27 PM Alan Lord <<a href="mailto:alanslists@gmail.com">alanslists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Bug filed and subsequently now closed.<br>
<br>
Thanks to Prasad for tracing the cause of the problem:<br>
<br>
For this customer's system, I have some custom validation routines that <br>
need Ajax (check vtiger_pbxlookup table for duplicate phone number <br>
etc...) which were quite hard to port to v7 - I had to intercept the <br>
recordPresaveEvent and then continue or not based on the results.<br>
<br>
It works for a "normal" EditView save in all browsers I tested. But when <br>
using Chrome (or any browser using the same engine, i.e. Safari, Opera) <br>
and when the the Edit is an overlay (i.e. using Add related record) it <br>
did something unexpected.<br>
<br>
I traced the error to one small bit of javaascript<br>
<br>
             if(!multiFields.length) {<br>
                 thisInstance.postValidated = true;<br>
                 form.submit();<br>
             }<br>
<br>
The above works fine in Firefox but in Chrome the code execution <br>
continues after the form.submit(); which is not what I intended to <br>
happen ;-)<br>
<br>
So all I needed to do was to add a return;<br>
<br>
             if(!multiFields.length) {<br>
                 thisInstance.postValidated = true;<br>
                 form.submit();<br>
                 return;<br>
             }<br>
<br>
Maybe this might help others at some point.<br>
<br>
Cheers<br>
<br>
Al<br>
<br>
<br>
On 04/07/18 10:18, Prasad wrote:<br>
> Alan,<br>
> <br>
> Please file issue on tracker and share access to review the mystery.<br>
> <br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div>