Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
Posts: 18
Registered: ‎09-03-2008
My Device: Not Specified

BB browser gratuitously reloads the page after button press

Hi all,

 

I have an HTML page that essentially consists of:

 

<html>

<input type="text" id="foo">

<input type="button" value="Save Card" onclick="doSomething();">

</html>

 

On Chrome, Firefox and IE this works great. doSomething() runs and that's all.

 

On the BlackBerry 9700 (5.0) and in the sim, doSomething() runs, and then the page is needlessly reloaded. This isn't what I want at all -- if I want to move around to another page, I'll handle that in the Javascript.

 

Any ideas how to keep the page from reloading on the BB? I've tried it with and without <form> tags, using a <button> instead of <input>, tried setting onclick to "doSomething(); return false;", but nothing I've tried works.

 

Any help would be much appreciated. Thanks!

 

Steve

Developer
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others
My Carrier: T-Mobile

Re: BB browser gratuitously reloads the page after button press

Try adding a href="javascript&colon;return false;".

5hould do the trick.