Highlighted

Pop Up with yes/no question AFTER a text field has reached its character limit

New Here ,
Aug 17, 2020

Copy link to clipboard

Copied

Hello,

I am pretty sure this is some intensive code so apologies in advance.  I am trying to have a pop-up appear with a yes/no question after a text field has reached its max character limit; depending on how the question is answered, I'll also need to set the focus to another text field.  

 

For example: I'll have the user fill in a Zip Code.  Immediatley after that, I want a pop-up to appear that asks if the user has a different mailing address.  If the user selects yes, there is a readied field (outside of the pop-up)  that I would like the focus to go to titled: Street Address.  If the user selects no, I would like the focus to go to a field titled: Agent ID.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Change the first line to:

if (AFMergeChange(event).length==event.target.charLimit) {

The code will "disappear" after you enter it, but will still work.

However, when the dialog appears the last character entered will not be visible. I have yet to find a way around that...

TOPICS
Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

102

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Pop Up with yes/no question AFTER a text field has reached its character limit

New Here ,
Aug 17, 2020

Copy link to clipboard

Copied

Hello,

I am pretty sure this is some intensive code so apologies in advance.  I am trying to have a pop-up appear with a yes/no question after a text field has reached its max character limit; depending on how the question is answered, I'll also need to set the focus to another text field.  

 

For example: I'll have the user fill in a Zip Code.  Immediatley after that, I want a pop-up to appear that asks if the user has a different mailing address.  If the user selects yes, there is a readied field (outside of the pop-up)  that I would like the focus to go to titled: Street Address.  If the user selects no, I would like the focus to go to a field titled: Agent ID.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Change the first line to:

if (AFMergeChange(event).length==event.target.charLimit) {

The code will "disappear" after you enter it, but will still work.

However, when the dialog appears the last character entered will not be visible. I have yet to find a way around that...

TOPICS
Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

103

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 17, 2020 0
Most Valuable Participant ,
Aug 17, 2020

Copy link to clipboard

Copied

You can use this code as the field's custom Keystroke script:

 

 

if (event.fieldFull) {
	if (app.alert("Do you have a different mailing address?",2,2)==4) this.getField("Street Address").setFocus();
	else this.getField("Agent ID").setFocus();
}

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 17, 2020 0
New Here ,
Aug 17, 2020

Copy link to clipboard

Copied

That is exactly what I want to happen!  Thank you!  The only issue is that it doesn't pop-up when the Zip Code field is filled, only if you try to exceed it.  Any solutions for that?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 17, 2020 0
Most Valuable Participant ,
Aug 17, 2020

Copy link to clipboard

Copied

Change the first line to:

if (AFMergeChange(event).length==event.target.charLimit) {

The code will "disappear" after you enter it, but will still work.

However, when the dialog appears the last character entered will not be visible. I have yet to find a way around that...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 17, 2020 0
New Here ,
Aug 18, 2020

Copy link to clipboard

Copied

EDIT: one more quick question, would it be possible to have the pop up appear on a tab action instead of trying to do it off a character limit?  

 

I am happy with how it works, but just so you know what I am seeing (in case I did something wrong), the pop-up appears as I type in the fifth character of the zip code (so character limit is reached).  At that point, the last character of the zip code does not appear, but when I select yes, it fills in the last character and the pop-up reappears instantanously.  I select yes again, and then the zip code remains filled and it takes me to the intended address field.  If I select no, it no longer takes me to the agent ID field.  

 

Honestly though, this is all that I wanted.  I super appreciate your time and help!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 18, 2020 0
Engaged ,
Aug 19, 2020

Copy link to clipboard

Copied

Did you have in mind something like this: video example. 

If you are still interested in this send me PM.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 19, 2020 0
Most Valuable Participant ,
Aug 19, 2020

Copy link to clipboard

Copied

It's not doing that for me. Beside the last character not appearing when the dialog opens it works perfectly for me...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 19, 2020 0
New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

No.  So the the Zip Code is in a section with an address so I don't want a pop-up to appear before the Zip Code is filled.  I wanted the completion of the Zip Code field to trigger a the pop-up.  See below (I have changed the field names since first posting this.)

 

Preston5FCD_0-1597938363741.png

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2020 0
Contributor ,
Aug 20, 2020

Copy link to clipboard

Copied

You can use pop-up "on blur" when you enter zip and exit field dialog will pop-up.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2020 0
New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

Can you explain that with coding by chance?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2020 0
Contributor ,
Aug 20, 2020

Copy link to clipboard

Copied

I Just read your posts and it seems you  want the pop-up when  you enter Zip code, so I don't belive you would like "on blur" since it requires you to click outside the field once you enter address. In a dialog box ( like one from Nesa) you can ask her to add extra fields so you input entire adress not just zip code, I belive that would be good option, or you can just use "on blur" and click outside the field once you'r done. 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2020 0
Most Valuable Participant ,
Aug 20, 2020

Copy link to clipboard

Copied

I think that will be very confusing for the user. If you want to use a dialog object then you should trigger it via a button field and populate the value into a (read-only) text field, not have it triggered by the text field itself.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2020 0
Asim123 LATEST
Contributor ,
Aug 20, 2020

Copy link to clipboard

Copied

Yes that would be better, but I think he just complicate his forms for nothing, I mean how hard it is to move mouse to a field and click on it. 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 20, 2020 0