i have a link in mobile jquery..
<div data-role="page" id="main" data-title="Main Page">
Here there are two textboxes which must be filled by the user. Then here is a link..
<a href="#sub" data-role="button" id="save" data-icon="star" data-theme="b" data-transition="flip">Show Employee Data</a>
"sub" is data-role="page" which displays the data of these 2 textboxes. I wrote in .js..
$(document).delegate('#save', 'click', function(e) {
if(document.getElementById('name').value=="")
{ alert('Name Not Entered..');e.preventDefault();return false; }
});
Every thing runs good, Alert is also shown, but second page is also shown because of href having id="save". All i need is to show this second page only after validation of first page.. Am i doing something wrong ?? Please suggest..
--EDIT-- I saw in break mode in chrome that just after clicking href second page gets loaded and then it enters in code. I have to stop this loading of second page immediately.. Is there anything we can write in a href"$sub" ... > ??