/    Sign up×
Community /Pin to ProfileBookmark

onClick="searchFunction(); return false;"

Hi,

I’m using this:

[COLOR=”Purple”]onSubmit=”searchFunction(); return false;”[/COLOR]

in my Form tag, and this:

[COLOR=”purple”]onClick=”searchFunction(); return false;”[/COLOR]

in my submit tag. It works in IE but not in Chrome.
When the page is reloaded (showing the results) the ”go back” arrow (upper left corner) is not functioning. This is verry annoying becouse the form doesn’t allow to go back (in history). How do I solve this?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 10.2010 — Why use both events? You only need [I]onsubmit[/I].

How is the page reloaded?
Copy linkTweet thisAlerts:
@yomooreauthorAug 10.2010 — Hi Fang,

You are right, I only need 'onSubmit' but I was using two of them because I thought it would solve my problem.

My problem is that I have a select list related to a search box. It's a simple 'search engine' sending a quary to google, yahoo etc.. When a visitor typs a search quary the results (google search, yahoo search etc.) is opend in the [B]same (main) window[/B] (so no tab/other window). The problem is that if a visitor selects an option (say yahoo) other than the default, typing a search quary and hitting enter or submit button, the select list [B]will first go to default state(google)[/B] and [B]erases the input field[/B]. Than [B]secondary[/B] the search quary is fired. Obvisiously

this is annoying for the visitor because his/here search term is [B]beeing erased and the select list is changing.[/B] The results however are good but because the form is [B]'resetting'[/B] it will cause some confusion. Also it' s not good for the loading time. I have tried to resolve this by "return false;" but now in Chrome, after the quary is given, the [B]''history/back'' button doesn't work[/B] anymore. In IE it works perfectly thow.
×

Success!

Help @yomoore 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.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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