[Vtigercrm-developers] Chrome "double" posting...

nilay khatri nilay.spartan at gmail.com
Wed Jul 4 17:46:25 GMT 2018


Just as an addition try to return a value as well (true or false based on
the validation).

On Wed, Jul 4, 2018 at 9:27 PM Alan Lord <alanslists at gmail.com> wrote:

> Bug filed and subsequently now closed.
>
> Thanks to Prasad for tracing the cause of the problem:
>
> For this customer's system, I have some custom validation routines that
> need Ajax (check vtiger_pbxlookup table for duplicate phone number
> etc...) which were quite hard to port to v7 - I had to intercept the
> recordPresaveEvent and then continue or not based on the results.
>
> It works for a "normal" EditView save in all browsers I tested. But when
> using Chrome (or any browser using the same engine, i.e. Safari, Opera)
> and when the the Edit is an overlay (i.e. using Add related record) it
> did something unexpected.
>
> I traced the error to one small bit of javaascript
>
>              if(!multiFields.length) {
>                  thisInstance.postValidated = true;
>                  form.submit();
>              }
>
> The above works fine in Firefox but in Chrome the code execution
> continues after the form.submit(); which is not what I intended to
> happen ;-)
>
> So all I needed to do was to add a return;
>
>              if(!multiFields.length) {
>                  thisInstance.postValidated = true;
>                  form.submit();
>                  return;
>              }
>
> Maybe this might help others at some point.
>
> Cheers
>
> Al
>
>
> On 04/07/18 10:18, Prasad wrote:
> > Alan,
> >
> > Please file issue on tracker and share access to review the mystery.
> >
>
>
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20180704/764197d2/attachment.html>


More information about the vtigercrm-developers mailing list