1

I am creating an HTML5 App using Intel XDK. In my first page (page_0) there are options to select the conversion style. When choose 1st option, it goes to page_1. There are some input boxes and buttons. When I hit calculate, it calculates the expression but immediately returns back to page_0. The button code is like this:

<a class="button" href="#" style="position: relative; z-index: 2;" data-appbuilder-object="button" data-position="static" data-transition="slide" id="calc_r_sft"   onclick="getValues_r_sft();">Calculate</a>

How to avoid this automatic navigation and let the user stay in the calculation page (Page_1)?

Vicky Gonsalves
  • 11,593
  • 2
  • 37
  • 58
user2749929
  • 21
  • 1
  • 4

3 Answers3

3

Modify

onclick="getValues_r_sft();" 

to

onclick="getValues_r_sft(); return false;"
Harry
  • 87,580
  • 25
  • 202
  • 214
inspiredMichael
  • 370
  • 4
  • 9
2

It looks like you are using App Starter. (http://appstarter.app-framework-software.intel.com/).

I could not reproduce the problem. I started a new app, created a 2nd page. Added a button to the page. Then I tried the app in the previewer. When I click on the button, it stays on the same page. This is the HTML I generated.

Button

rscohn2
  • 899
  • 7
  • 10
0

try using <div> instead of <a>

www0z0k
  • 4,444
  • 3
  • 27
  • 32