2

i have a form for User Registration, it was working perfect before but now its not submit and doesn't get any error. i tried to show all my post data but its not post any data.. please help

 <form role="form" id="reg-form" method="post" class="form-horizontal" action="{{ url('/create_user') }}"> {{ csrf_field() }} <h2>Create Account</h2> <div class="form-group"> <div class="col-sm-6" id="user-firstname"> <input type="text" class="form-control" id="firstName" name="firstName" placeholder="First Name" required="required"> </div> <div class="col-sm-6"> <input type="text" class="form-control" id="lastName" name="lastName" placeholder="Last Name"> </div> </div> <div class="form-group"> <div class="col-sm-12"> <input type="text" class="form-control" id="displayName" name="displayName" placeholder="Choose your display name" required="required"> </div> </div> <div class="form-group"> <div class="col-sm-12"> <input type="email" class="form-control" id="email" name="email" placeholder="Your Email" required="required"> </div> </div> <div class="form-group"> <div class="col-sm-12"> <input type="password" class="form-control" id="password" name="password" placeholder="Password" required="required"> </div> </div> <div class="form-group"> <div class="col-sm-12"> <input type="password" class="form-control" id="confirm_password" name="confirm_password" onkeyup="checkPass(); return false;" placeholder="Confirm Password" required="required"> <span id="confirmMessage" class="confirmMessage"></span> </div> </div> <button type="submit" class="btn btn-primary btn-block">Sign in</button> </form>

Route

Route::post('/create_user', 'Auth\RegisterController@createUser'); 

Method

public function createUser(Request $request) { dd($request->all()); } 
10
  • When it was working before, what have you changed? Commented Mar 28, 2017 at 14:25
  • I can't see any submit button. If you're submitting the form with JS, look into browser console, maybe there is an error. Commented Mar 28, 2017 at 14:26
  • Where's the code for thr submit button? Commented Mar 28, 2017 at 14:29
  • @pseudoanime please check after edit .. Commented Mar 28, 2017 at 14:32
  • @StephenHendricks i haven't changed any thing Commented Mar 28, 2017 at 14:33

3 Answers 3

2

I think you forgot to close some open tag above the form. It happened to me too.

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

Comments

0

Possible error is the "/"

<form role="form" id="reg-form" method="post" class="form-horizontal" action="{{ url('/create_user') }}"> 

so plz remove it like

<form role="form" id="reg-form" method="POST" class="form-horizontal" action="{{ url('create_user') }}"> {{-- '/' removed --}} 

and also in

Route::post('create_user', 'Auth\RegisterController@createUser'); // '/' removed 

It worked for me.

Comments

0

Replace {{ csrf_field }} with {!! csrf_field !!}}. It will work

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.