I am trying to validate a year field (item) to ensure that the field is 4 digits and fits between 1960 and 2059. I want to do this before I submit the page, preferably after leaving the field through tab or click out. Any thoughts?
Using the settings for numeric items should do this for you (from 5.1). If the submit page is pressed, APEX will do it's best to do any client side validation before submitting.
You can create a dynamic action to test the value yourself on change, but you should retain any server side validation.
There are also some plug-ins that can help, such as Live Validation.
Related
I'm currently using Oracle APEX. I have this validation that executes error message whenever an item is null. And I have created a dynamic action when losing focus, it formats into a currency format.
I have this problem whenever I submit the page, my item becomes null / my validation executes.
My assumption is that validation comes first before the dynamic action.
Validation
Item is not null
Dynamic Action
Lose Focus
Action
Execute PLSQL that formats to a currency value.
Scenario:
Fills-up an item
Click submit button ahead
Expected Result:
Empty validation should not trigger when page is submitted.
Actual Result:
Empty validation is triggering when page is submitted.
Try this set you offending validation to never and make sure the dynamic action is doing what you want. Oracle in general is klugy with number formatting.
I am creating an application on Oracle Apex version 18 that takes survey from users.
I have used form on table for that purpose. However, users are able to submit the form multiple times. Is there a way to freeze the submit button once the form is submitted?
Yes; you have to be able to find out whether it was already submitted (for example, record in a table gets its ID; or, survey_date gets is set to sysdate).
Then create a condition for that button. A simple option is to use a function body that returns Boolean, e.g.
return :P1_ID is null;
which will render the button only if :P1_ID item is empty. If it is not, you won't see the button any more.
In the first instance I would try setting the page attribute Enable duplicate page submissions to No.
It seems like you don't want users to be able to answer the same survey multiple times.
In order to achieve this you can use a server side condition as Littlefoot suggested, but you seem to have problems with setting up the server side condition properly.
If you use a hidden item on your page, which holds the value of the current survey the user has to answer like "P1_SURVEY_ID", you can add a server side condition that doesn't allow the user to answer it again, if he already has:
Type: No rows returned
SQL Query: select * from YOUR_SURVEYS where SURVEY_ID = :P1_SURVEY_ID;
This way the user can only click the button if he has not answered this specific survey yet.
This is a easy solution:
https://community.oracle.com/thread/4167853?start=15&tstart=0
Simply add the "Page Submit" TRUE Action to your Dynamic Action and
set the Show Processing "o Yes. Then you don't even need any Enable or
Disable Actions on your button.
I have created a page based on "Form & Report" template. So there is the Report page on which there is the create button. That create button leads to the form page which contains.
It is pretty simple. I don't know if there is a cache memory not emptying itself or if there is a setting that I have not properly set.
When I want to create a new database record, Oracle Apex behaves as if I asked it to update a record (though it still presents me with empty text fields).
Below the image of what's happening.
Create button of the Report
Buttons for edit are shown when I click the create button
Those edit buttons are shown instead of the buttons below => This means that the Apex software is behaving like I asked to edit a record not to insert a record.
Why is this happening?
You need to take a look at your create button. Is it passing a value to the form? If so, you probably don't want that. Is it clearing the cache of the form? If not, you probably want to clear it.
Also, on the form page take a look at your processes.. specifically the Automated Row Fetch (ARF) process.. what's the primary key that this process is using?
Also, take a look at the conditions for each button on your form. For the delete/save buttons you likely want a condition type of "value of item / column in expression 1 Is NOT NULL".
For your create button you would want the opposite.. "value of item /... IS NULL".
In both cases for the expression 1 you'd want to use the item that your ARF is leveraging.
#Bloomberg58 if you used the wizard that should not have anyway try to validate the create button in report page and the server-side validation of create and save button in form page
I am working on Microsoft office infopath 2007.I have inserted the controls as text box and drop down. when i get right click to control there are 2 option links as Data validation and Rules. what are the main difference in between them? I am new in infopath so need guidance.
when to use rules and when to use validations. can we customize validation and rules? and can we define custom rules and validation in infopath ?
Data validation can be used to display error alerts when users enter incorrect values into a form. Rather than checking for errors after a form is completed, data validation verifies values as the form is being filled out.
You can use rules to automatically display a dialog box, set a field's value, query or submit to a data connection, switch views, or open or close a form in response to certain events and conditions.
I'm not sure that you can create your own custom rules and data validation. But infopath forms can be customized by writing programming code to respond to form and data validation events, to access and manipulate a form's underlying XML document, to implement custom data submission and merges, and to implement access to external data sources.
What would be the best design layout for a web form with more than 100 fields? Right now I have grouped the fields to tabs.I am having tough time in validating the fields.I should either validate it on 'Submit' of the form or on tab change.Both has its own drawbacks. If I validate on tab change then user cannot view other tabs till they fill all the mandatory fields in the previous tab.Also it is not an good idea to throw so many validation messages to the user when he submits the form.
Please share your thoughts..
You can use a stepwise process. In the first step provide all the most important fields. Then on the click of a 'Next' button you can go to the next step and so on. By validating the fields you can allow the user to go to the next step.