hi everybody,
If anybody can help me please, I have the next situation
I have a form as follow,
where both DEPARTAMENTO and SOLICITANTE are in the same page (LlenarFormularioSolicitud), and AREA is in the LlenarComboArea partial page, area is rendered when I choose any option of DEPARTAMENTO select box, I would like make a database query based in area id selected, somethig like this,
select solicitante_column from solicitante_table where id_area = "ID AREA SELECTED IN THE SELECT BOX"
and then assign the solicitante_column value to SOLICITANTE text box in the form, but I don't know how do it.
The Application map that I have is like this,
If anybody can help me please, I have the next situation
I have a form as follow,
where both DEPARTAMENTO and SOLICITANTE are in the same page (LlenarFormularioSolicitud), and AREA is in the LlenarComboArea partial page, area is rendered when I choose any option of DEPARTAMENTO select box, I would like make a database query based in area id selected, somethig like this,
select solicitante_column from solicitante_table where id_area = "ID AREA SELECTED IN THE SELECT BOX"
and then assign the solicitante_column value to SOLICITANTE text box in the form, but I don't know how do it.
The Application map that I have is like this,
RE: database query based on the select box option selected
The easiest option for this would be to use the same approach as you have used for the existing AREA select box.
Create a partial page that contains the SOLICITANTE field, and link this partial page from the LlenarFormularioSolicitund page in the same way as the LlenarComboArea partial page is.
You can then add an onchange event to the AREA select box (in the LlenarComboArea partial page) to do an AJAX Submission to load in the new SOLICITANTE field.
As the LlenarComboArea partial page is connected to the LlenarFormularioSolicitund main page you can select any actions that originate from this main page, which will include the new action added to load your new partial page.
When setting the Target Group for the AJAX Submisison action, you will need to use the Enter group name option and type in the name of the target group in the main page.
You can then add your SQL to the partial page controller rules as needed.
I hope this makes sense. There are other options available to achieve this, but this partial page approach is probably the easiest to get working.
Regards,
Gerard
RE: database query based on the select box option selected