cancel
Showing results for 
Search instead for 
Did you mean: 

date validations in adobe form

Former Member
0 Kudos

Hi

i have two textfields in adobe form with labels TODATE AND FROMDATE,where TODATE should always be greater than FROMDATE.can you please tell me where to write validations for adobe form and what is the code required for it.

Thanks

krishna

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Write this code inside submit button.

As Date class is implementing Comparable interface u can use "compareTo(Object)" method which returns integer value

Try this code.

Date from=get the From Date(from the attribute)

Date to=get the TO Date (from the attribute)

int i= from.compareTO(to);

if(i>0)

to date is bigger

else if(i<0)

from date is bigger

else

both r same.

Regards,

Sunaina Reddy T

former_member192434
Active Contributor
0 Kudos

Hi kirshna,

You can write code inside action of submit button.

Thanks

Anup

Former Member
0 Kudos

hi!

you can create actions on onCheck and onSubmit in the property of interactive form and then do your your validation there.

thanks

vishal

Former Member
0 Kudos

Hi vishal

thanks for your reply ,but i dont have any button in side interactive from, ihave a button SUBMIT outside interactive form as soon as i click on SUBMIT button validation need to be performed.

Thanks

Krishna

Former Member
0 Kudos

you can also create one method and call that method from onCheck action.if you dont have any button in tour form then try doing this in modifyView.i am not sure whether it will work or not and also it will cause a performance issue as it will hit server multiple times so i think its better to take submit button inside the form.

thanks

vishal

Former Member
0 Kudos

hi!

please refer to this thread

thanks

vishal