/    Sign up×
Community /Pin to ProfileBookmark

stopping redirect on form submittal

hey guys, is there any way for you to stop a page from changing its location when you submit a form? for example, when you click on the submit button, the form sends the stuff in it to the place in the action paramater, but doenst change the location of the page. ive tried a bunch of stuff, refreshing the page wont work in my application because its getting stuff to make the form from a product database. any help would be much appreciated.

~Hal

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@ExuroApr 15.2004 — Try changing the form's target attribute to either a different frame or a different window:

<form action="form.php" method="post" [color=red]target="_blank"[/color]>
Copy linkTweet thisAlerts:
@steelersfan88Apr 15.2004 — ... or target to another frame, so that it is completely hidden. However, the target attribute is deprecated ?

(after doing a tad of research on this, the target attribute will only validate in transitional, not strict, HTML and XHTML)
Copy linkTweet thisAlerts:
@lahmayesauthorApr 15.2004 — its deprecated and they dont have some sort of alternative?
Copy linkTweet thisAlerts:
@steelersfan88Apr 15.2004 — i don't know of one ?
Copy linkTweet thisAlerts:
@lahmayesauthorApr 15.2004 — hmm, looks like i have some issues with the w3c, haha im sure they know what theyre doing, guess ill have to use this until i figure out somehting else... thanks guys.
Copy linkTweet thisAlerts:
@steelersfan88Apr 15.2004 — it works under transitional, just not strict, so chnage doctypes accordingly ?
Copy linkTweet thisAlerts:
@lahmayesauthorApr 15.2004 — hmmm... i think ill keep my doctype and just live with 1 error. :-/ so it goes.
×

Success!

Help @lahmayes 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...