dimanche 6 août 2017

Set to true state a checkbox in a different page(javascript)

This is how i so far i get on getting what i want.

javascript

function linkPageContact(clicked_id){
  if(clicked_id === 'website-design-check'){
        $('#website-design').attr('checked',true);
        window.location.href = "/contact";
    }
  }
}

I want to check my checkboxes when i click the button with an id=website-design-check here is my

first.html*

 <a href="/contact" target="_blank"><button type="button" class="btn btn-success btn-block" 
    id="website-design-check" onclick = "linkPageContact(this.id)">Appointment</button></a>

now this is my

second.html where in the checkboxes are here.

<input type="checkbox" aria-label="Checkbox for following text input" id="website-design"
       name="website-design">

Now how can i achieve what i want base on the description i stated above . can you help me out guys please. I'm stuck here for an hour . I can't get any reference about getting a checkbox state from another page.




Aucun commentaire:

Enregistrer un commentaire