Skip to content

(PHP version) Checkbox unable to set default "checked" (Fixed by my own) #6

Description

@sospixs

Example

$form1->addCheckboxField('ckb_flag','Label',true);

I've found why that not working. That because in razorflow.wrapper.min.js
options.value is not pass correct value from setting. Value always show 'undefined'
(null==(__t=options.value===!0?"checked":"")?"":__t)

I've fixed on my own way.

  1. Edit FormComponent.php by chage array property name from 'value' to another and this is my code
    +$opts['options'] = array('isCheck'=>$value); // New code added.
    -$opts['options'] = array('value'=>$value); // The original code.

2 Edit razorflow.wrapper.min.js
+(null==(__t=options.isCheck===!0?"checked":"")?"":__t) // New code edited.
-(null==(__t=options.value===!0?"checked":"")?"":__t) // Original code

And that work fine. I'm not sure this problem was issue on javascript version or not?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions