0

I am currently using PHP form element : the submit button as

<input type="submit" name="submit" value"set"/>

and the form was being submitted like :

if(isset($_POST['submit']) && $_POST['submit'] == 'set'){..do something..}

Now in bootstrap a submit button is usually written as

<button type="submit" class="btn btn-success btn-sm">set</button>

My question is how to submit this form data since I cannot do it like the previous way. It might be a noob question but I am new to bootstrap. Any suggestions would be of great help.

4
  • add a hidden input with name submit? Check other fields in $_POST array? Commented Nov 4, 2016 at 15:04
  • 1
    There are ample (bootstrap) scripts out there using what you're wanting to do; you just need to spend some time looking for them. Commented Nov 4, 2016 at 15:05
  • what is this line expected to do $_POST['submit'] == 'set'? Why in the world you will use isset($_POST['submit']) when you have $_POST['submit'] = 'set' Commented Nov 4, 2016 at 15:06
  • use to <input type="submit" name="submit" value"set" class="btn btn-success btn-sm"/> Commented Nov 4, 2016 at 15:07

1 Answer 1

1

This has little to do with bootstrap. You can set a name and value attribute on a button as well as an input[submit].

<button type="submit" class="btn btn-success btn-sm" name="submit" value="set">
    set
</button>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.