Reputation: 476
I want a text field to be hidden for default for a TextField in Laravel Form and then Unhide it when I click a checkbox..
How can I do that ?
Tried adding style properties to the TextField :
{{Form::text('Password', $user->email, array('class' => 'form-control' , 'style' => 'visible = false;'))}}
didn't work..
Upvotes: 0
Views: 2767
Reputation: 1103
{{Form::text('Password', $user->email, array('class' => 'form-control hidden'))}}
and on javascript:
$(document).ready(function (){
$('#checkbox').change(function (){
$('.form-control.hidden').removeclass('hidden');
});
});
Upvotes: 3