0

my issue is not sending email , issue is after click on submit nothing happens even echo not working I have a form in Bootstrap. There's a button called "submit" where when it's clicked the stuff that was entered in the form should be sent to an email address. Although when I click "Submit" nothing happens.

<?php


  if (isset($_REQUEST['email']))  {

  echo "sadfsdagsdgsdg";
        }

?>

Html

 <form method="post" class="form floating-label text-left form-validate" name="frm" id="frm" >

                    <div class="row">
                      <div class="col-md-6">
                        <div class="form-group">
                            <input type="text" class="form-control" id="Name" name="Name" required data-rule-minlength="2" />
                            <label for="Name">Name</label>
                          </div>
                      </div>

                      <div class="col-md-6">
                        <div class="form-group">
                          <input type="text" class="form-control" id="Contactnumber" name="Contactnumber" data-rule-number="true" required />
                          <label for="Contactnumber">Contact Number</label>
                        </div>
                      </div>                         

                    </div>

                    <div class="row">
                      <div class="col-md-6">
                        <div class="form-group">
                          <input type="email" class="form-control" id="Emailaddress" name="email" required />
                          <label for="Emailaddress">Email Address</label>
                        </div>                            
                      </div>

                      <div class="col-md-6">
                        <div class="form-group">
                          <select id="guestDetails" name="guestDetails" class="form-control select2-list dirty" required>
                            <option value="">Select your gang</option>
                            <option value='cap'>Cap - N1,000</option>
                            <option value='gele'>Gele - N2,500</option>
                            <option value='agbada'>Agbada - N13,500</option>
                            <option value='lace_gele'>Lace with Gele - N12,500</option>
                            <option value='lace_asooke'>Lace with Aso-Oke - N13,500</option>
                            <option value='adult_lace'>Adult's Lace with Aso-Oke - N20,000</option>
                          </select>
                          <label for="guestDetails">Cap/Gele/Lace/Agbada</label>
                        </div>
                      </div>
                    </div>


           <div class="rsvp-button text-center">

                        <button type="submit"  name="submit" value="submit" class="hvr-sweep-to-right">Submit</button>

                  </div> 
                  </form>
user3183225
  • 65
  • 1
  • 1
  • 10

1 Answers1

-1

Just try using

<input type="submit" value="Submit" class="hvr-sweep-to-right">

instead of

<button type="submit" name="submit" value="submit" class="hvr-sweep-to-right">Submit</button>

  • Do or do not. There is no "try". A ***good answer*** will always have an explanation of what was done and why it was done in such a manner, not only for the OP but for future visitors to SO. – Jay Blanchard Mar 14 '17 at 19:10
  • A `button type=button` element is similar to `input type=button`; the difference is that the latter has no content but takes the text shown in the button from the value attribute, whereas button has content that can be “rich” (with markup). – Jay Blanchard Mar 14 '17 at 19:15
  • I disagree entirely. First in regards to your above comment about not needing to add an action, while technically yes you don't need to add an action, it's always a good idea to be explicit, not implicit. And second, due to the fact that we can't see underlying circumstances that could be happening on the site, he should TRY using the input type of submit, rather than a button type of submit as it may circumvent the issue he is having. – The Code Dad Mar 14 '17 at 19:18
  • I don't disagree that we should be explicit, but technically in this case it is not required. Trying a change from button to input is essentially doing the same thing because the button is part of the form and there wouldn't be any underlying circumstance which would prevent the button from submitting unless he has employed JS with a `preventDefault()` that we cannot see. My gut says the OP is not using JS at all at this point. – Jay Blanchard Mar 14 '17 at 19:21