Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Selected" not set for select_field #2226

Open
brianread108 opened this issue Jan 23, 2025 · 1 comment
Open

"Selected" not set for select_field #2226

brianread108 opened this issue Jan 23, 2025 · 1 comment

Comments

@brianread108
Copy link

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

@brianread108
Copy link
Author

<select class="input" name="status"><option value="disabled">Disabled</option><option value="enabled">Enabled</option><option value="test">TEST</option></select>

<select class="input" name="hookScript"><option value="disabled">Disabled</option><option selected="" value="enabled">Enabled</option></select>```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant