0

I have a question about Apex Forms. I have a form with 10 fields, out of which 2 fields are "start_date" and "end_date", I want to ensure that end date must be >= start date, before the page is submitted. But the session state variables don't get user entered values until the page is submitted.

I want a way so that I can access/manipulate fields values before the page is submitted (so to reduce network traffic). Can someone please let me know how I can do it? please help.

Thanks in advance.,

user2755525
  • 219
  • 2
  • 3
  • 14
  • Could you help more by clarifying the process flow of the use case you presented? What fields are optional? What does a `SUBMIT` event signify? At what point is the user going back to revise or add to their data from the original input? Where does the data go after `SUBMIT` is reached? – Richard Pascual Mar 11 '14 at 10:42

2 Answers2

1

The only way to check the form without submitting it is via Javascript. You could have a button that calls a Javascript function to check the data before submitting the form. See this SO question for some guidance on comparing dates in Javascript.

If you are not experienced with Javascript then this will be quite tricky! Are you sure it is necessary?

Community
  • 1
  • 1
Tony Andrews
  • 129,880
  • 21
  • 220
  • 259
  • Thanks Andrew, I know Javascript up to some extent. Can you tell how to call a Javascript function from within APEX Page? I will also look at the link you provided. Thanks again. – user2755525 Mar 07 '14 at 18:09
  • One way is to create an APEX button that redirects to a URL and make the URL like `javascript:my_function();`. Then create the definition of `my_function` in the Javascript section of the page attributes. – Tony Andrews Mar 08 '14 at 10:00
0

You can use validation components for those kind of things: http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/bldr_validate.htm

bobek
  • 8,003
  • 8
  • 39
  • 75