Expand my Community achievements bar.

Drop Down Box Message for Custom Text

Avatar

Former Community Member

Hello and apologies in advance if this is a complete "newb" question.  I have a drop down box with only 2 choices - 1 Hr and 1/2 Hr.  I set the box to allow custom text, but if a user does enter custom text, I just need a message box to pop up to say "That's an unusal time - are you sure it is correct" but still allow them to enter it.  What I have so far is:

if ($.boundItem(xfa.event.newText) == "1 Hr" || $.boundItem(xfa.event.newText) == "1/2 Hr") {
  xfa.host.setFocus("rosfinmon");
}
  xfa.host.messageBox("Please check your contract and if correct just leave the way it is.  Otherwise please select from the drop down choices", "That's an unusal break time", 3);
  endif
//-

This works, however it will not let them enter the custom text and leave it as it.  I just need a little warning to tell them that what they are putting in is a little unusual, however it is allowed.  Then I just need the focus to be on "rosfinmon" to allow it.

I am using LiveCycle Designer ES2

Thanks in advance

5 Replies

Avatar

Level 1

Hello, mjbdbase2

I think I got the solution for your problem! You also don't need to edit the XML code for this. Well...

First right click on the drop down box you have created. Then select 'Palettes' and then select 'Object'. Now, right of the LiveCycle window, you will be in the 'Object' tab. In the 'Object' tab, click on the 'Field' tab and select the checkbox saying 'Allow Custom Text Entry' (see image below).

Knipsel.JPG

Now that's done, go to the 'Value' tab, which is also in the 'Object' tab. In the drop down box saying 'Type', select 'Calculated - User Can Override'. In the box saying 'Override Message', enter any message you want to appear when a user enters custom text in your drop down box.

Knipsel.JPG

Don't forget to save your form, and test it out! When you open the form and enter custom text in your drop down box, your entered message will appear, and you will be able to click 'Ok' or 'Ignore'. If you click 'Ok' your entered text will be deleted. If you click 'Ignore', your entered text will stay in the drop down box.

~Wumb0

Avatar

Former Community Member

Heh Thanks so much Wumbo1!  I really appreciate the assistance.  Unfortunately this didn't work.  I had tried this previously, but it is obviously something very strange I have done that won't allow any pop up to show with over ride.  I did, however, accomplish this task with

xxx.timesheet1.rosfinmon::exit - (FormCalc, client)
if ((rosmealmon.rawValue == "1 Hr") or (rosmealtue.rawValue == "1/2 Hr")) then
xfa.host.setFocus("ResultHoursmon")
else
xfa.host.messageBox("Please check your contract and if correct just leave the way it is.  Otherwise please select from the drop down choices", "That's an unusal break time", 3);
endif


This does seem to work ok.

I appreciate your time.

Avatar

Level 1

Hello mjbdbase2,

So you fixed it with the code, it works fine now? Glad to hear that. No problem, sad thing that it won't allow the pop up... Anyways, when I found a solution for the message blocking problem, I'll post it here. Hope everything works fine further on, and if not, I'll be there helping you. I only don't know much about the codes so unfortunately I can not help with the codes... Oh, and also thanks for the code at all, when I become stuck in a same kinda problem I can try fixing it with that!

~Wumbo1

Avatar

Former Community Member

I did Wumbo1 and I thank you for trying anyway.  I'm thinking the message won't work on the palette side of things more because of the way I have set the form up (validations etc) rather than an issue with LC.

Thanks for taking the time for answering

Avatar

Level 1

I can't think of an other solution yeah...

Anyways, it worked, so good luck with the form

And of course no problem!