Kevin Powell - CommunityKP-C
Kevin Powell - Community15mo ago
30 replies
snxxwyy

forms | action and method

Hey, i have a couple of questions about the action and method attributes for forms-

1) With action, what necessarily does sending data to other html/pfp files etc do? I can imagine it's so you can use it with js that's hooked up to the page it's sending to to either use it in a query or display it on the page. This makes sense to me since i imagine you'd have to use a database or something similar to retrieve data between pages without this functionality. let me know if i'm wrong though please.

2) With the GET method, what's the function of appending the data to the url? What does it allow you to do?

3) When would you use GET vs POST? I assume POST when sending the form data somewhere with action. With GET, the answer depends on the answer to question 2) but it would confuse me if you had a GET method with a link in action as where is the data going at that point if you're getting data from somewhere else?

I'd appreciate any help clearing this up, thank you in advance.
Was this page helpful?