Skip to content

"Selected" not set for select_field #2226

@brianread108

Description

@brianread108

Can someone explain why the hookScript field gets its default "selected" set according to the value indicated whereas the status field does not get a "selected" set,

<p><span class=label>
		%=l('lets_SERVICE_STATUS')
	</span><span class=data>
		% my @status_options = [['Disabled' => 'disabled'], ['Enabled' => 'enabled'], ['TEST' => 'test']];
		% param 'status' => $lets_data->{status} unless param 'status';
		%= select_field 'status' => @status_options, class => 'input'
	<br></span>	</p>
	<p><span class=label>
		%=l('lets_HOOKSCRIPT_STATUS')
	</span><span class=data>
		% my @hookScript_options = [['Disabled' => 'disabled'], ['Enabled' => 'enabled']];
		% param 'hookScript' => $lets_data->{hookScript} unless param 'hookScript';
		%= select_field 'hookScript' => @hookScript_options, class => 'input'
	<br></span>	</p>

{
"hookScript" => "enabled",
.....
"status" => "test",
}

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions