Tell me how to submit , so that the text in it is located in two lines. Just shorter than the text for the button you can imagine, but it turns out it is too long.

    2 answers 2

    Button text is not a string that can be formatted, but the value of this button. You can simulate the submit button, but using JS, jQuery, etc. For example:


     <form method="POST" action="#" id="my_form"> <p> <input type="text" name="some_key" value /> </p> <div id="my_submit">Моя собственная кнопка!<br />Отправить запрос</div> </form> 

    CSS (here you will make the button look like you want)

     #my_submit { width: 180px; padding: 3px; border: 1px solid #900; cursor: pointer; } 


     $('#my_submit').click(function(){ $('#my_form').submit(); }); 
    • A very good option, so I'll adjust them to the buttons on the form. Only here is the question (I'm starting to program the current on the web) where can I push jQuery so that the event works? - I 'm living
    • found everything where the div added onclick = "..." - I ’m living
    • And if the visitor has javascript turned off? :] - nolka

    Maybe the button tag will resolve the issue?

     <button>Очень длинный текст<br />из двух строчек</button> 
    • yes he decided. that's just a pity different from other buttons. Well, what can I do, think of something - I LIVE
    • 2
      To less different, apply css. - barber