SOLVED Assistance with Implementing Field Validation in JavaScript

Ask your questions here.
Post Reply
brave
Sponsor
Sponsor
Posts: 180
Joined: 17 Jul 2016, 12:34
Name: Patrick
Location: Germany

SOLVED Assistance with Implementing Field Validation in JavaScript

Post by brave »

I hope this message finds you well. I am currently engaged in an interesting project and could really use your expertise. I'm working on implementing a JavaScript function in a form to check if a specific field (Invoice Number) is filled out before saving the data. My current code is as follows:

Code: Select all

if($('#fields_1494').val()=='')
{
  alert('Bitte Rechnungsnummer eintragen');

  //to enable Save button
  $('btn btn-primary btn-primary-modal-action').prop('disabled',false);

  //to stop form submit
  return false;  
}
This script functions perfectly in the "Form Configuration" under "Add JavaScript". However, I am encountering some difficulties when trying to use the same code in the "Actions" within "Stages".

Could you perhaps provide any insight into why this might be happening? Is there a specific adjustment I should consider to achieve the same functionality in the "Stages"?

Thank you in advance for your help and support.

Best regards

addendum:
works as it should, the field must be present in the action field, a check beyond other actions is not possible, after I hidden the field it works as it should. solved!
Post Reply