As a novice, this question may be a bit ridiculous, I hope you guys don’t laugh at it
I have a form written in form
How can I make the form content real when I click submit? Submit it (or save it)
instead of clicking the submit button and getting nothing! I didn’t understand it even after looking at other people’s source code
手机用户6954531022018-12-14 11:27:01
One attribute of the form is action, which is the access address where you want to submit data to the background. In fact, it is the controller of tp5.
And there must be a button in the form, and the button type is submit.
You can also use ajax,
$.ajax({
url: "This is actually the same as the action in the form, which is the address you want to submit",
data:$("form").serialize()//Data submitted by the form
type: "POST",//Submission method
dateType : "json", method of interacting with the background
Success:function(res){
Successful callback function
}
});
迷人的徐叔叔2018-12-14 01:16:42
This needs to interact with the background using ajax (ps: I don’t understand it very well)