Well pretty much because I don't fully know what I am doing, I am fairly new to javascript. I implemented a function as seen below, but now I am getting errors. The navigation works the first time, but when the second page loads, there is an error thrown when I check the console in Chrome:
- Uncaught TypeError: Cannot read property 'options' of undefined
changeMyPage
onchange
Any pointers for my next step? Thanks for your help!
- <form name="nav">
- <select name="list" data-mini="true" onChange="changeMyPage();">
- <option selected>Choose a Report</option>
- <option value="index.php">Home Page</option>
- <option value="info2.php">Orders Created by Day</option>
- <option value="info.php">Shipments by Day</option>
- <option value="info3.php">Picks by Day</option>
- <option value="info4.php">Orders Created by Day by Client</option>
- <option value="info5.php">Shipments by Day by Client</option>
- <option value="info6.php">Picks by Day by Client</option>
- </select>
- </form>
- <script>
- function changeMyPage()
- {
- var x = document.nav.list.options[document.nav.list.selectedIndex].value;
- $.mobile.changePage(x);
- }
- </script>