I am trying to determine if a checkbox is checked with jQuery multi page setup, but it always returns "false" unless I mark the item as "checked" per default.
My code looks pretty basic to me:
<script>
function updateUrls(){
console.log('test: ' + $('#filter_pic').is(':checked'));
});
</script>
<form>
<input type="checkbox" name="filter_pic" id="filter_pic" onchange="updateUrls();">with pix
</form>
The reason for this might be, that this code is inside a multi page setup. In fact the code looks similar to this:
<div data-role="page" id="select_dienstleistungen">
<div data-role="content">
<script>
function test() {
console.log('test: ' + $('#filter_pic').is(':checked'));
};
....
<form>
<input type="checkbox" name="filter_pic" id="filter_pic" onchange="updateUrls();">with pix
</form>
</div
<div data-role="page" id="select_jobs">
<div data-role="content">
<script>
function test() {
...
How is it possible to address the item inside the pages? All those pages have the same checkbox item as the code is valid for all those different pages.