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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Contributor
Posts: 2
Registered: ‎05-10-2010
My Device: 9800
My Carrier: T-Mobile DE

radiobutton onClick->Submit not sending values

Hello!

 

I am facing some strange behavior of the BlackBerry Browser on newer devices (9800 and 8900 tested).

Within a Webapp we have been using for years on all kinds of BlackBerry devices a set of radio buttons exist using the folowing code:

 

 

...
<td>
<input name="variante" value="600" checked onclick="document.getElementById('action').value='artikeldetail';this.form.submit();"
 type="radio">
</td>
</tr>
<tr><td>660</td><td>Farbe 660</td>
<td><input name="variante" value="660" 
onclick="document.getElementById('action').value='artikeldetail';this.form.submit();"
 type="radio">
</td>
</tr>
<tr><td>670</td><td>Farbe 670</td><td><input 
checked="checked" name="variante" value="670" 
onclick="document.getElementById('action').value='artikeldetail';this.form.submit();"
 type="radio">
</td>
...

Whenever one of the radio buttions is clicked, the form submits, but the value of "variante" is always "600".

If I remove the preselection by removing "checked" from the first radiobutton, the browser doesn't send a value for "variante" in its POST request at all.

 

It seems as if the form was submitted prior to setting the value of the clicked radio button.

 

Has anyone experienced similar behavior on 4.6 devices?

Is there anything I can do to force the device to send the value?

 

Kind regards,

 

Kolja

 

 

New Contributor
Posts: 2
Registered: ‎05-10-2010
My Device: 9800
My Carrier: T-Mobile DE

Re: radiobutton onClick->Submit not sending values

I looked a little further into this issue and realized the problem is with the onClick  thats used.

OS 4.6 devices execute onClick before the value of the input element is changed. Those devices work fine when onChange is used instead.

 

However, OS 4.5 and lower devices do not support onChange and thus don't submit the form when onChange is used.

 

Using both onChange and onClick in each input tag works on <4.6 devices, but newer devices will still execute the onClick and not change the value.

 

As a workaround I am going to use a hidden field and set its value within the onCloick event.

 

Still I'm curious to know, what a best practice suggestion of RIM would look like.