简体   繁体   中英

Passing value from view to controller using a href link

Hi I want to pass data from input value to controller without using a submit button. I want to use a link to post the form input instead. Is there any way using php only and without javascript or jquery? Thanks.

Short answer to your question is no, but you can easily submit the form using javascript by adding the onclick event handler to the link.

try this

<a href="#" onclick="this.form.submit()">Submit</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM