2

The code is like this:

{{ Form::hidden('id') }}
<td class="td-actions">
    {{ Form::checkbox('active', 'active',true) }} 
    {{ Form::hidden('active', 'inactive',false) }}
</td>
{{Form::close() }}

On displaying the value in web browser I get both values-active & inactive in both ckecked & unchecked cases.

How can I get rid of that?

1 Answer 1

1

You should have the hidden input before the checkbox, and use numeric values rather than booleans:

{{ Form::hidden('active', '0') }}
{{ Form::checkbox('active', '1') }}

If the checkbox isn’t checked, then you will get a value of 0. If the checkbox is checked, then you will get the checkbox’s value (1).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.