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
Highlighted
Developer
Posts: 29
Registered: ‎08-19-2009
My Device: Not Specified

JQuery Mobile Header Button not firing click event

[ Edited ]

Good Day All,

 

I'm having a problem with my app. I have an edit button in my header that when clicked, is not firing the javascript function. I have included some code below. If I try to add a button that is not a link, it works, but the button shows up on a new line (see attached photo). Any ideas?? Everything seems to work fine in Safari web browser, but when it comes to the application on the simulator, it doesn't work as planned.

 

Thanks,

Rocketman

 

<div data-role="header">  

<h1>Host Details</h1>  

<a data-role="button" data-direction="reverse" href="#home">Back</a>  WORKS

<a data-role="button" onclick="showHostButton(); return false" rel="external" id="hostEditBtn">Edit</a>    DOESN"T WORK

 <!--  <button id="hostEditBtn" name="submit">Editt</button>  -->  WORKS but format is not a header button

<!-- <input type="button" value="EDIT" id="hostEditBtn" /> --> WORKS but format is not a header button

</div>

 

$('#hostEditBtn').click(function() {

$('#contactPerson').removeAttr("readonly");

$('#contactEmail').removeAttr("readonly");

showHostButton();

hideHostEdit();

});

 

EDIT:

It seems that the javascript is not working on the <a> tags when the code is on the simulator/iPad. Everything works fine through Safari or Chrome. Any ideas? Anyone else experiencing this problem??

 

Thanks,

Rocketman