Submit form using a button outside the <form> tag

前端 未结 13 1530
南旧
南旧 2020-11-22 09:45

Say I have:

13条回答
  •  无人共我
    2020-11-22 10:12

    I had an issue where I was trying to hide the form from a table cell element, but still show the forms submit-button. The problem was that the form element was still taking up an extra blank space, making the format of my table cell look weird. The display:none and visibility:hidden attributes didn't work because it would hide the submit button as well, since it was contained within the form I was trying to hide. The simple answer was to set the forms height to barely nothing using CSS

    So,

    CSS -

        #formID {height:4px;}
    

    worked for me.

提交回复
热议问题