Hi everybody, i made a website using asp and everything it's ok until i notice that the buttons it's not working when using a blackberry. Do anybody has a clue how to get this done.

Dani AI

Generated

Quick summary and why the symptoms point away from a server-side ASP bug: the confirm dialog appearing but the page not navigating afterwards is frequently a client-side problem — most often malformed/generated HTML, a JavaScript-event handling mismatch (onclick on a submit control vs. the form submit event), or a device/browser quirk that bypasses or blocks in-page dialogs. your sample shows inline onclick on submit buttons and some odd-looking generated markup; and were right to suspect BlackBerry quirks, but the first checks should be the page you actually serve to the device. (developer.mozilla.org)

Step-by-step checks (fast, high-yield)

  1. Save/view the rendered HTML that the BlackBerry actually loads and validate it (missing quotes, stray tags will break older mobile engines). Use the W3C validator or view-source to find syntax errors.
  2. Make sure no control is named submit (that masks the form.submit() method); avoid accidental name collisions. (validator.w3.org)

A robust, cross-device pattern (works around submit-button oddities)

  • Render plain buttons (type="button") for each action, carry the action name in a data attribute, and submit programmatically only after confirm succeeds. This avoids relying on browser-specific submit behavior and keeps a single, testable code path.

Example pattern:

<form id="replyForm" method="post" action="replyemail.asp">
  <input type="hidden" name="id" value="...">
  <button type="button" data-action="Confirm">Confirm</button>
  <button type="button" data-action="Regret">Regret</button>
</form>

<script>
document.getElementById('replyForm').addEventListener('click', function(e){
  var btn = e.target.closest('button[data-action]');
  if(!btn) return;
  if(!confirm('Are you sure you want to ' + btn.dataset.action + '?')) return;
  var h = document.createElement('input'); h.type='hidden'; h.name='action'; h.value = btn.dataset.action;
  this.appendChild(h);
  this.submit();
});
</script>

Handling confirmation on the form/submit path is more reliable than per-button onclicks; prefer a submit-event handler or the pattern above. (stackoverflow.com)

Device-specific notes and final tests

  • Test on the actual BlackBerry (or emulator) with a minimal form (one submit) to isolate the issue. Some BlackBerry browsers expose their own submit UI or ignore certain in-page handlers — that can bypass preventDefault/onclick behavior. If the site must work without JS, provide a server-side fallback (links/GET or a confirmation server page). (stackoverflow.com)

If these steps still fail, post the exact rendered HTML (view-source output) from the device and a short description of the BlackBerry model/OS — that will let people pinpoint whether it is markup, a naming collision, or a device/browser quirk.

Recommended Answers

All 11 Replies

post your buitton code,

<form method="post" action="reply.asp" target="_self">
<%
for each x in rs.Fields
if x.name="id" then%>
<td align="center"><input type="submit" name="id" value="<%=x.value%>" onClick="return confirm('Are you sure you want to process this customer?')"></td>
<%else%>
<td align="left" ><span class="BodyTextbigPartA"><%Response.Write(x.value)%> </span></td>
<%end if
next
%>
</form>

or maybe this code example :

<form method="post" action="replyemail.asp" target="_self">
<input name="id" type="hidden" value=<%=id%>>
<input type="submit" name="action" value="Confirm" onClick="return confirm('Are you sure you want to send confirmation of reservation?')">
<input type="submit" name="action" value="Regret" onClick="return confirm('Are you sure you want to send the denial of the reservation')">
<input type="submit" name="action" value="Pending" onClick="return confirm('Are you sure you want to send notice to your colleague?')">
<input id="bkk" type="submit" name="action" value="Back">
</form>

i have no clue were it is the problem .....

neither do I,
I was hoping for a quick fix, missing quote or something, but the code looks right, except for closing semicolons in the javascript (should be but doesnt generally matter)
so perhaps the blackberry
support for html buttons is limited in software versions below 4.6

it might be, but from what i tested for example other buttons from different sites work on the blackberry, for example the google search button.

zero that thought then, blackberry must be updated to 4.6 or higher
google button code

<input name=btnG type=submit value="Google Search" class=lsb>
<input name=btnI type=submit value="I'm Feeling Lucky" class=lsb>

has different 'Name' attribute, perhaps that is the sticking point for your code. In my mind a series of buttons with the same name are radio buttons which do not show up in the list of supported types on a blackberry
try action action1 action2 for name attributes ( ?? )

hth

it doesn't change the situation, even with the code changed. If you see the first example it's only one button and it;s not working also and blackberry ver. is 4.6.
And at the beginning it wasn't writed this code

onClick="return confirm('Are you sure you want to process this customer?')"

, but curiously it's showing me the popup but if i agree with it doesn't redirect me to the asp page.

this is a typical problem, which was left by my friend months ago. Maybe to get a new system.

that means i'm stuck

Member Avatar for Member #120589

I've noticed Blackberry behaves strangely with certain js and ajax apps. My ajax sites work with other mobiles (Nokia etc), but BB seems to stick two fingers at inline js.

10x for the opinion but it's no way out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.