Reputation: 61
I have a problem here. The form not redirect to the process file after I click the button.
This is the form code :
<form action="add_testimonial.php" method="POST" enctype="multipart/form-data">
<input type="text" class="form-control" placeholder="Name" name="nama">
<input type="email" class="form-control" placeholder="Email" style="margin-top: 10px;" name="email">
<textarea rows="2" class="form-control" style="margin-top: 10px;" name="text"></textarea>
<input type="file" class="form-control-file" style="margin-top: 10px;" name="foto_profil">
<input class="btn btn-success btn-block" type="button" value="Send testimonial" name="finish" style="margin-top: 10px;">
</form>
Hope anyone can help my problem.
Upvotes: 0
Views: 50
Reputation: 141
Change your input type "button" to "submit"
<input class="btn btn-success btn-block" type="submit" value="Send testimonial" name="finish" style="margin-top: 10px;">
Upvotes: 0
Reputation: 1112
The last button should have the following type:
<input class="btn btn-success btn-block" type="submit" value="Send testimonial" name="finish" style="margin-top: 10px;">
Type submit
garantee that you send the form data to the action
page. Here are a few explanations from the Mozilla Team.
Upvotes: 0
Reputation: 797
Change input type button to submit
<form action="add_testimonial.php" method="POST" enctype="multipart/form-data">
<input type="text" class="form-control" placeholder="Name" name="nama">
<input type="email" class="form-control" placeholder="Email" style="margin-top: 10px;" name="email">
<textarea rows="2" class="form-control" style="margin-top: 10px;" name="text"></textarea>
<input type="file" class="form-control-file" style="margin-top: 10px;" name="foto_profil">
<input class="btn btn-success btn-block" type="submit" value="Send testimonial" name="finish" style="margin-top: 10px;">
</form>
Upvotes: 1