0

I have a button that I need in the submit, when I click submit I get

http://localhost:xxxxx/add?dashname=1&tabname=2&dashtype=Local

But I need

http://localhost:xxxxx/add?dashname=1&tabname=2&dashtype=Local&dashicon=fa-plus

<div class="form-group">
            <div class="col-lg-2 col-md-3 col-sm-4">
              <label for="dashicon" class="control-label">Icon</label>
            </div>
            <div class="col-lg-10 col-md-9 col-sm-8">
              <button id="icondash" type="submit" data-toggle="dropdown" name="dashicon" style="text-align: left;" value="fa-plus" class="btn btn-default dropdown-toggle form-control"><i class="fa fa-plus"></i><span>Add1 </span><i class="fa fa-caret-down"></i>
              </button>
              <ul role="menu" style="text-align: left;" class="dropdown-menu animation-slide">
                <li class="dashicon"><a href="javascript:void(0)"><i class="fa fa-plus"></i><span>Add1</span></a>
                </li>
                <li class="dashicon"><a href="javascript:void(0)"><i class="fa fa-pencil"></i><span>Add2</span></a>
                </li>
                <li class="dashicon"><a href="javascript:void(0)"><i class="fa fa-print"></i><span>Add3</span></a>
                </li>
                <li class="dashicon"><a href="javascript:void(0)"><i class="fa fa-times"></i><span>Add4</span></a>
                </li>
              </ul>
            </div>
          </div>
          <div class="form-footer col-lg-offset-2 col-md-offset-3 col-sm-offset-4">
            <button id="createdash" type="submit" class="btn btn-primary">Create</button>
            <button id="canceldash" type="submit" class="btn btn-default">Cancel</button>
          </div>
3
  • when i put this code in my pc its show this when i click on submit ?dashicon=fa-plus# can u explain what u want ? Commented Feb 23, 2017 at 6:19
  • and you need to surround you code with form tag with put this you goal is mission impossible 5 :D Commented Feb 23, 2017 at 6:21
  • This form-group is inside <form class="form-horizontal" role="form"> Commented Feb 23, 2017 at 13:04

1 Answer 1

1

When you submit a form then the values of its buttons are not submitted with it. only value of button which cause submit is submitted with form. in above example if you click on add1 button only then its value is submitted with it.

there is other way to submit values like this use input type="hidden"

<input type="hidden" name="nametosubmit" value="your value">
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.