Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Input box

Hi,

Using the custom option in the input box . We can check the input box value against the constraint set.

Is it possible to restrict the user to enter only the specific format in the input box . Like only the date format can be entered in the input box?

4 Replies
suniljain
Master
Master

to restrict user to enter only valid value. you have to use macro.

Miguel_Angel_Baeyens

Hello,

You can set a custom rule, for example

=Index($, '/') > 1 and Index($, '.') > 1


So the variable will accept "3/3.3" or "A.B/C" but not "10000"

You can customize it to your needs and date format.

Hope that helps.

Not applicable
Author

Thanks Sunil and Miguel,

I have used the below macro for to check the same. It is checking whether it is in date format or not. but not able to define as dd/mm/yyyy or mm/dd/yyyy.

Sub Checkformat
Set v = ActiveDocument.Variables("Date")
value=v.getcontent.String
result= (IsDate(Value))
Msgbox(result)
Msgbox(value)
End sub

Any suggestions on the same.

Not applicable
Author

One my colleagues just sent me this so I cannot take credit..... I believe this is what you were looking for (no macro).

Contrain your input box with the following:

len(date(date#($))) > 0 AND date#($) < date#(vEndDate)

Provide an Error message:

='Invalid Date. Use format: ' & (DateFormat) & ' and Start Date must be less than End Date'