/    Sign up×
Community /Pin to ProfileBookmark

onclick in IE doesn’t submit form at first go

hi guys
I have been stuck with this issue for many hrs now..can anyone please help?

my page #s on a search results page trigger a function that submits the page’s search form.

this is how I generate the page #:
echo ‘&nbsp;&nbsp;<a href=”javascript:void(0);” onclick=”return Paginate(‘.$i.’);”>’.$i.'</a>’;
where $i is in a loop.

This is the Paginate function
function Paginate(p)
{
//alert(“valu ” + document.getElementById(‘formSearch’).current_page.value);
var frm = document.getElementById(“formSearch”);
var btnSubmit = document.getElementById(“btnSearch”);
frm.current_page.value=p;
//document.formSearch.submit();
frm.submit();
}

My form is declared as:
<form action=”main.php” method=”post” id=”formSearch” name=”formSearch”>

And the submit button is declared as:
<input name=”btnSearch” type=”submit” id=”btnSearch” value=”Search”>
(just one submit button).

Now in FF, it works fine. In IE, it seems to call the Paginate function since I can see the popup window (the alert call in the function)…but the form wont submit.

Funny thing is.. you click the page number.. form won’t submit immediately.. but you click on another link or the submit button yourself, and it will suddeny show the refreshed page with the new page number.

someone please help with this IE wackkiness ?

thanks guys

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@themartyAug 12.2008 — do you have a page online that illustrates this?
Copy linkTweet thisAlerts:
@HoboScriptAug 12.2008 — I'd get rid of that return in your onclick. Just call the function.
Copy linkTweet thisAlerts:
@thearbitcouncilauthorAug 13.2008 — Hobo you are right.. a user on another forum told me to do nearly the same, and it worked!

marty:

The site can be accessed at

http://streettalk.in/

Use the login/pwd as tac0/1234.. still pvt beta types.

The page in question was left menu bar -> network->click search -> use pagination

thank you once again for your help.
×

Success!

Help @thearbitcouncil 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.18,
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,
)...