Copy link to clipboard
Copied
Hello,
I am working on a new form that requires the input of bank account information. I would like to have 2 fields for the routing and 2 fields for the account number. I want to be able to display a message if the 2nd input does not match the 1st. Just trying to add an additional layer of verification.
Optimally Id like to stack the fields and show the verification field on top of the initial field to avoid the old copy and paste, but I am sure there are a few more mechanics invloved in that implementation.
Can someone help me with this request? Thanks!
JT
I generally dont like pop-ups but this solution checks off all of my requirements. The code works as intended.
Thank you for your assistance.
Copy link to clipboard
Copied
What kind of message? Text on the page? A pop-up alert window?
Also, should it only appear when the second field is edited? What about if the first one is edited after the second has a value, and they no longer match?
Copy link to clipboard
Copied
My recommendation is to use a single read-only field for each input then use a response object to collect the routing and account numbers and only populate the field value when the values coming back from the response match. It would look something like this...
var routing1 = app.response("Enter the routing number");
var routing2 = app.response("Enter the routing number again");
if (routing1 == routing2) {
this.getField("routingNumber").value = routing1;
}
else {
app.alert("Routing numbers don't match");
}
You'll need to put the code into a button or link near the field since it is read-only and won't get mouse clicks.
Copy link to clipboard
Copied
I generally dont like pop-ups but this solution checks off all of my requirements. The code works as intended.
Thank you for your assistance.
Copy link to clipboard
Copied
You don't have to use a pop-up. You can set the error message as the second field's value, for example, or even a third field, just used for that warning message.