How to set dynamic Checkbox default to checked

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
rafee
User
Posts: 34

How to set dynamic Checkbox default to checked

Post by rafee »

I have Lookup table which is set to Checkbox.

Example: Deductions (column name)

I set the Edit tag to Checkbox and selected the Lookup table.
Now, the default is unchecked for the dynamic result values.

How will I set the generated checkboxes value to checked by default?


mobhar
User
Posts: 11741

Post by mobhar »

It actually depends on the value in the Link field. Let's say the Link field type is Integer for that "Deductions" field, and you want to implement it only for the Add/Copy Page, then simply put this code in "Row_Rendered" server event, and then re-generate ALL the script files again:

if (CurrentPageID() == "add") {
$this->Deductions->CurrentValue = "1,3,4"; // this will select the first, third, and fourth CheckBox control selected by default in Add/Copy Page
}


rafee
User
Posts: 34

Post by rafee »

Thank u but the checkboxes are dynamic (number of checkboxes will depends on the selection).

On page rendered, there are NO checkboxes yet to display since I have to SELECT first the "Deductions" to show all deductions lists(checkbox).

I think this is done in Client script? Im not that really sure BUT the checkboxes are generated upon selection. How will I code that way?
Again, thank you mobhar


mobhar
User
Posts: 11741

Post by mobhar »

Then please post your tables schema including your customization/setup already you did for more discussion.


Post Reply