Closed Luizgpp closed 8 years ago
+1
If you want to put HTML inside your button you can’t use this helper but you can still the regular HTML button with the other helpers.
I know that I can use regular HTML on forms. I've tried it. But, it doesn't work with Form Model Binding.
But you can mix the two so just use the helpers for the inputs and HTML for the button. Form model binding has no influence on submit button unless I’m missing something?
What do you mean by mixing the two? How would I do that? Can you provide some examples?
Let’s say you have a text field named content
that you’re going to use with Form-model binding but you still want to create that submit button with HTML inside. You just use the Form helper for the text field and regular HTML for the button.
{!! Form::model($model, ['method' => 'POST', 'route' => 'your route'] !!}
{!! Form::label('content', 'Content') !!}
{!! Form::text('content', null) !!}
<button class="btn waves-effect waves-light" type="submit" name="action">Submit
<i class="material-icons right">send</i>
</button>
{!! Form::close() !!}
I am currently trying to migrate a project from bootstrap to Materialize. Unfortunately the registration form is not working in materialize. When I try to register a new user, I can create 1 user and hash the password but the name, username and email fields are not being received by the request. They submit as null. Here is a sample of my code. The other fields are basically the same to avoid repetition.
@extends('layouts.app')
@section('content')
<div class="row">
<form method="POST" action="{{ url('/register') }}"
{{ csrf_field() }}
<div class="row">
<div class="input-field col s12">
<input id="name" type="text" placeholder="Your full name" class="" value="{{ old('name') }}">
<label for="name">Name</label>
</div>
Maybe that is because you don't have a name property/attribute on your text field?
@extends('layouts.app')
@section('content')
<div class="row">
<form method="POST" action="{{ url('/register') }}"
{{ csrf_field() }}
<div class="row">
<div class="input-field col s12">
<input id="name" name="name" type="text" placeholder="Your full name" class="" value="{{ old('name') }}">
<label for="name">Name</label>
</div>
</div>
How i can use this submit button with laravel using form.
Materializecss: http://materializecss.com/buttons.html
This not working.