xtrim Posted June 1, 2003 Posted June 1, 2003 Hi I have two fields "start_date" and "end_date". I use validation for both of them : Start_date -> start_date>=status(currentdate) End_Date -> End_date<(start_date+62) These validation does not seem to be working on the web. I tried JS but I found only validation for empy fields. 1. why these validations does not work on the web (FMP 6 U!) ? 2. Any other way it can be done ?
EddyB Posted June 1, 2003 Posted June 1, 2003 Hi, Works fine on the web for me. I just did a quick test and the validation worked. I am using FMU 6 as well I set a field (StartDate) to date format Then set the validation to validate by calculation: StartDate>=status(currentdate) Then tried on my web form to enter the StartDate as 01/01/2002 and it came up with my error page when I tried to submit. Ed.
xtrim Posted June 2, 2003 Author Posted June 2, 2003 Hi Yes, bet the End_date validation is still not working. BTW, I hope you checked with CWP and not IWP....
EddyB Posted June 2, 2003 Posted June 2, 2003 Hi, I see the problem now, it is not that form validation does not work on the web, it is just your second validation does not work. Your second validation will always return an error. The reason for this is the validation is based on the users input into the start date field. The way FM is working will not handle this, it checks the validation rules before entering any data into the database off the web. So when it is at the point of checking the validation for the 2nd field, the Start Date field is still blank, as FM is still at the validation stage, it has not yet entered the data off the web. Therefore the validation on Start_Date + 62 is working out BLANK + 62, so your validation will fail as your End_Date will not meet that criteria. You have 2 options really from what I know. 1. Split the input form into 2 pages. The 1st page will ask for the start date, user enters this and submits, 2nd page asks for the end_date, user enters this and submits. At this point the database has a value for Start_Date so the validation will work. 2. Use Javascript as you said, I could probably come up with something to check this when I get a minute if you need me to. Let me know which option you're going for and let me know if you need anymore help. BTW, these may not be your only options, other members may be able to give you other options, but this is just what I know of it. Regards eD.
xtrim Posted June 2, 2003 Author Posted June 2, 2003 Hi It's too much work now to start desining Web page all over again. I just gave you one example of validation that is not working... I have like 10 more... Thts is why I will have to use JS... I will need your help I guess that after you show me one example I will manage. TNX
Anatoli Posted June 2, 2003 Posted June 2, 2003 Another way is to validate through calculated field. FM Field validations are very bad for WebCompanion, but field calculations not. If you will make validating calculation field with result Yes or No, it is the easiest way to check that in CDML. That can be programmed in Lasso as well.
xtrim Posted June 3, 2003 Author Posted June 3, 2003 Hi I Made a calc field : if(end_date>start_date,"y","n") I've entered validation in End_date : c_field="Y". Well, it looks like no matter what I enter, I get Error-507 (which is validation error...). What could be the problem?
Anatoli Posted June 3, 2003 Posted June 3, 2003 You should check the result in CDML: If calc field = Y something else something else Endif
Recommended Posts
This topic is 7913 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now