Jump to content
Sigmahokies

checkbox and paginate page

Recommended Posts

Hi everyone,

I'm trying to create the look like "paginate data page", but it is not. I set up the file to insert in website by iframe, but I need to find a way to make clicked data like click the checkbox, then click on next, go to next file in iframe, then come back, stay checked in checkbox. Do you understand what I mean? I'm not fluent in English, my prime is American Sign Language.

Share this post


Link to post
Share on other sites

If you want to save data across pages on the same domain, you can use sessionStorage for that.

Share this post


Link to post
Share on other sites

I used session storage, seem it doesn't work. I use localstorage, seem it works a little, but stayed checked on checkbox has not work. here code I get from other website, but seem function is not right

	<script>
    function onClickBox() {
        let checked = $("#box").is(":checked");
        localStorage.setItem("checked", checked);
	        $("#msg").text("Checkbox is checked: " + $("#box").is(":checked"));
    }
	    function onReady() {
        $("#msg").text("Loaded.");
	        let checked = "true" === localStorage.getItem("checked");
        $("msg").prop('checked', checked);
	        $("#box").click(onClickBox);
    }
    $(document).ready(onReady);
</script>
<form>
    <div id="msg"></div>
<table>
    <tr><th colspan="3">Spatial Verbs</th></tr>
    <tr><td>Go/Walk-To/From</td>
        <td><input class="single-count" type="checkbox" id="box" name="chkboxGrp0[]" value="1"></td>
        <td class="vert-middle">0</td></tr>
	

Share this post


Link to post
Share on other sites

You're not using the correct selector to check the box again, you're trying to target a "msg" tag.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...