This topic is locked

Checkbox With Dependent Dropdown

1/29/2013 2:21:24 PM
PHPRunner General questions
S
stiven author

Hello,
I am wondering if there is any way to have a field as a checkbox but that is dependent from a dropdown, the settings in the program won't allow me to do it. is there a work around to this? the other thing I tried was to have a dropdown with multiline rows and it works when I save the record, lets say I selected 2 rows from the table id 1 and 3, then it is store as 1,3 but when I go to edit page with the multiline rows only 1 is selected. the best way would be to use checkboxes i hope this is possible.
Thanks for your help

G
gdmacdo 1/29/2013

I needed this function too. I am using ASPRunner, but possibly this could help.
I have a dropdown field called "Infraction". When an infraction is selected, I want the person to be able to check optional consequences based on the infraction. The checkbox field is "Additional_Consequences".
Additional_Consequence does a lookup of the Consequence table and I have a WHERE statement of:
"Infraction = '" & Session("Infraction_List") & "'"
Under Events page, Add Page, Process record values, I have this statement:
session("Infraction_List")=values("Infraction")
In the After record added Event:
response.redirect "dbo_ODR_Incident_edit.asp?editid1="&keys("ID")
In the Javascript onload event:
var ctrlInfraction = Runner.getControl(pageid, 'Infraction');

var ctrlAdditional_Consequence = Runner.getControl(pageid, 'Additional_Consequence');
ctrlInfraction.on('change', function(e){

ctrlAdditional_Consequence.setValue();

$("a[id^='saveButton']").click();

});
This is what happens. When the Infraction dropdown is changed, the record is immediately saved, I record the content of the Infraction field into a session variable, and user goes to the edit page of that record. Now, the "Additional_Consequence" field has the lookup necessary to display the checkboxes.
On my edit page, I have the following events:
Process record values:

session("Infraction_List")=values("Infraction")
JavaScript OnLoad Event:
var ctrlInfraction = Runner.getControl(pageid, 'Infraction');

var ctrlAdditional_Consequence = Runner.getControl(pageid, 'Additional_Consequence');
ctrlInfraction.on('change', function(e){

ctrlAdditional_Consequence.setValue();

$("a[id^='saveButton']").click();

});
I hope this helps.