I have a form which has 4 items:
A yes or no fill in
2 items if yes
1 item if no
I would like to create a dynamic action that would disable the field(s) that I do not need, enable the one(s) that I do need, and set the focus to the (first) enabled item. Additionally, it should be able to switch back and forth without a page refresh.
I tried making a couple of dynamic actions, but I noticed that it would only change once. For example, if I were to enter 'yes' into the first field, it would enable and disable the appropriate fields, but when I would switch the first field to 'no', nothing would changed.
Any help would be greatly appreciated. Thanks in advance.
It sounds like you need to fill in the Condition field (in the When sction) on the dynamic action and then include a True Action and a False Action.
For example:
Condition equal to 'Yes'
True Actions: Display 2 items
Hide 1 item
False Actions: Hide 2 items
Display 1 item
If this doesn't resolve your issue, you should try listing the values you have used for all the fields on your dynamic actions. Without seeing the values, it is difficult to troubleshoot.
Related
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.
Any help would be highly appreciated.I am working on Nintex form and currently stuck with this rule to be worked.
I have first checkbox as YES/NO (Name: NA), trying to create a rule where automatically all the options (Name:Options) below automatically go uncheck when somebody clicks on this first "Not Applicable". If it could hide all the below options after clearing that would be great but not requirement. Definitely clearing them out is requirement.
Is there anyone who can help me with this. Thank you.
It would really help to see some screenshots of your form and it's controls.
However, I can tell you that a rule will not be able to change the values of another control. For this, you're going to want to use JavaScript in the Settings -> Custom JavaScript section.
I will often show/hide a portion of a form based on the selection of a control. And, when the section is hidden, I always want to clear out any data that may have been entered into those (now hidden) fields.
Here's an example:
Image of Form Example
And here's the code:
NWF$('#' + myYesNo).change(function(){
NWF$('#' + myChoices + ' input').prop('checked',false);
});
Every time the Yes/No field is checked, everything in the Choices field is unchecked.
I would also suggest adding a rule to the Choices field (and its label) that says not(myYesNo): like this.
If you didn't want to hide the choices, I would expand the JavaScript to test whether or not the Yes/No is currently true or false. However, hiding the choices entire remove the need for that test.
I have an apex page that has some search items filled by the user. One of these items is a check-box with 4 values used to search. For example, 4 check-boxes(but only 1 item) with the values A:B:C:D. I have 4 reports(one for each check-box value), that must be showed only in case of the corresponding check-box is marked. So, I put a SQL condition in each report, ex: for report 1, condition => :P324_MY_CHECKBOX like '%A%', for report 2, condition => :P324_MY_CHECKBOX like '%B%' ...
When user fill the form, he clicks on "Search" button that invokes a dynamic action. This DA sets the items on the session and refresh the 4 reports. The expected result would be to show only some regions, according to the selected check-boxes. The problem is that the condition doesn't work in this case of refresh. I can see in the apex session that the item P324_MY_CHECKBOX doesn't has the value "A" for example but the corresponding report is still showed.
Resuming, the condition of region doesn't work(is not re-evaluated) if I refresh the region in a Dynamic Action.
Has anyone had this kind of problem? Is there an expert or guru to help me?
Thank you for your attention!
Conditions are evaluated on render of the page while dynamic actions are javascript commands that operate on the rendered page.
Instead show all regions without conditions and control the hide/show using your dynamic action.
I am working on a windows form .Net application using QTP and there are a set of checkboxes which are repeated and all have the same property.I need to select the one particular checkbox from each set.If the checkbox is not visible on the screen then we need to scrool down else in pops a error message.Is there a way to select one particular checkbox from each set.
eq:
abc feature
1
2
3
abc feature
1
2
3
4
abc feature
1
2
i need to select checkbox 1 from all the set.
You need to find a way to identify a "checkbox set" use the object spy or a dom inspector to see what identifies the set (probably some kind of div or span) for the sake of this answer I'll assume that it's a div with a specific class "chkbxGrp".
Then look for the first checkbox contained within this group and check it.
Note that scrolling the checkboxs into view is done automatically by QTP.
If you need to fail this when an expected group doesn't exist you will have to find out how to identify specific groups and then use the expected values in the test rather than iterating over all such groups.
' Untested code
Set Desc = Description.Create()
Desc("html tag").Value = "div"
Desc("html tag").RegularExpression = False
Desc("class").Value = "chkbxGrp"
' Find all groups
Set groups = Browser("B").Page("P").ChildObjects(Desc)
For i = 0 To groups.Count -1
' in each group check the first checkbox
groups(i).WebCheckBox("index:=0").Set "ON"
Next
You can "identify" the checkbox using QTP index.
It's not the best option to do, though if you need only the 1st checkbox.
Just look for all Objects on the page of a type "CheckBox", and if the result set > 0, get the first one.
The second option is to "locate" the Checkbox by the nearby elements, but in this case you need to be sure that their location is NOT to be changed.
BTW, are you sure they are completely identical? In QTP there is an option to set necessary attributes for elements location. You can add any attribute which is unique for the CheckBoxes appearing in your app.
In MVC-3/Razor, I need to create a page which will have five set of controls. Each set will have a drop-down and a text box. User will select an option from drop-down and then provide some feedback on text box.
When the view is shown very first time, I only have to enable controls in first set. Whereas all controls in 4 other sets should be disabled. Once user perform action in first set of controls (select optino from drop-down and enter in text box), the second set should become enable now, whereas other set of controls should still be disbaled. The data shown in this second drop-down is dependent upon what user has selected in first drop-down. Once user complete action in this second set, the data in third drop-down will depend upon whatever user selected in first and second drop-down etc.
I am a web-form aspx developer and not sure what will be the best way of designing this in MVC-razor world (because there is not view state etc).
Step 1)
What needs to be clarified is what will cause the other “sets” to be enabled?
Is it after the user has selected an item in the dropdown
OR
Is it after they have entered some text in the textbox?
What also needs to be clarified is if you have a dropdown AND a textbox are they both enabled at the same time or is the textbox only enabled after you’ve selected an item in the dropdown?
Once you’ve got that figured out, move on to the next step.
Step 2)
Do the users need to visually see the 4 sets from the beginning (disabling the 3 other sets) or can you simply show the other sets (on the fly) once the previous one has been successfully filled?
Depending on the answers, this may vary your approach.
As for me, the way I’d do it is simply have/show one set that loads at the beginning.
Once the user has selected an item from the dropdown, I would make an AJAX call passing along the selected item and get back a list of values for the second dropdown.
Then, using jQuery, I would duplicate the row (or div) of the first set all while changing the values in the second dropdown box.
Repeat process for when an item is selected in the second dropdown.
But wait! There’s more!!!
Let’s assume you’ve reached the third set. What if the user decides to change the value in the first dropdown? What are your requirements if that happens? Should you remove all other sets and start back at square one? I guess so…
Since we are not aware of the full set of specs for your tasks, we can only assume stuff and this may (or not) be the best path to take.
Duplicating a row (or a div) using jQuery is quite fun and performance wise, it’s nice.
Keep in mind, you will have to give a different ID to your controls (dropdown + textbox) so when you submit the form, you could use the FormCollection to get those dynamically generated controls.