on 02-18-2014 9:40 AM
Hi,
I am using JAvascript in my ADOBE form and my requirement is to check the date of birth entered by the user.
The date should be < current date and the calculated age on current date should be >= 18 years.
Could anyone help me to achieve this.
Thanks,
Shilpa Bansal.
In adobe form in the context tab you have systems field(sfpsy-date).From that drag the date on to the context.In the layout of teh adobe form create a text field and bind this system date.
Now in javascript u can use this text field fo your validation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhijit,
The comparison operators are not working as desired.
I have coded in EXIT event:
if (this.rawValue >= employeeform.currdate.rawValue);
xfa.host.messageBox("DOB cannot be greater than current date","Error",0);
But when i test it, it always gives the error message even if the date entered is < the value in employeeform.currdate.rawValue.
Any pointers?
Thanks,
Shilpa BAnsal.
hi,
You can also use date = xfa.timeStamp;
Miguel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Does anyone have any solution to this problem.
I am really stuck up in it.
Thanks,
Shilpa Bansal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can find out the date by using javascript
var date = new Date();
var d = ((date.getDate().length)<1? date.getDate():"0"+date.getDate())
var m= (date.getMonth()+1).length<1? (date.getMonth()+1):"0"+(date.getMonth()+1);
var y = date.getFullYear();
var date1 = (d+"-"+m+"-"+y).toString();
Hi,
I found a set of Date and time functions which can be used in adobe forms.
One of the function is current-date(). I tried using it in event initialize for a date fild but it doesn't give any output. If i use Date(), it gives the current date with day and time.
If i use var v1 = Num2Date(Date(), "YYYY-MM-DD") it also doesn't give any value.
I am confused at to which functions can be used in adobe forms-java script.
P.S. The alternative provided by Varun Vadnala is working but my aim is identify if the Date functions can be used or not.
Thanks,
Shilpa Bansal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.