Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
to restrict user to enter only valid value. you have to use macro.
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.
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.
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'