/    Sign up×
Community /Pin to ProfileBookmark

function with if to check post method

I want to have a function that will check to see if a form method is a “post” of “get”. This way is surfer presses the “submit” button I can use the js function to do something, if the page loads without someone pressing the “submit” button, the js will do something else.

I hope this message makes sense.

Thanks,

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@CharlesSep 19.2004 — It's hard to tell from you description but I'm guessing that you want to be playing with "location.search".
×

Success!

Help @arthur spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...