Jump to content

dylan42

Members
  • Posts

    14
  • Joined

  • Last visited

dylan42's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. this is the code - x is 'yes' but the output does not show 'checked' on output ??? <html><head><script>function selectCheckBox(){ var x="yes" if(document.getElementById('x').checked==true) {{} document.frm.id4.checked=true } if(document.getElementById('x').checked==false) { {} document.frm.id4.checked=false }} function selectCheckBox1(){ if(document.getElementById('y').checked==true) { {} document.frm.id3.checked=true } if(document.getElementById('y').checked==false) { {} document.frm.id3.checked=false } }</script> </head><body><form name="form"> x <input type="checkbox" id="id13" name="id3" value="{id3}" ><br>y <input type="checkbox" id="id14" name="id4" value="{id4}"><br></form> </body></html>
  2. In javascript How can I check a checkbox dependant on a variable i.e if Var x is “yes” check the checkbox (tick) Else don’t check the checkbox (leave the checkbox empty) Many thanks
  3. no - but I'm looking at JavaScript for a solution
  4. Members 10 posts 0 warning points Posted Today, 01:12 PM I have a sample HTML that I have copied from the website - I want to output the result of these two checkboxes to two more checkboxes that reflect the results . How do I do this ? <!DOCTYPE html>< html>< body> <form action="demo_form.asp" method="get"> <input type="checkbox" name="vehicle" value="Bike"> I have a bike<br> <input type="checkbox" name="vehicle" value="Car" checked="checked"> I have a car<br> <input type="submit" value="Submit">< /form> </body>< /html> so I want the results are 'Car' with the checkbox displayed and 'Bike' with the checkbox displayed Thank you
  5. I have a sample HTML that I have copied from the website - I want to output the result of these two checkboxes to two more checkboxes that reflect the results . How do I do this ? <!DOCTYPE html><html><body> <form action="demo_form.asp" method="get"> <input type="checkbox" name="vehicle" value="Bike"> I have a bike<br> <input type="checkbox" name="vehicle" value="Car" checked="checked"> I have a car<br> <input type="submit" value="Submit"></form> </body></html> so I want the results are 'Car' with the checkbox displayed and 'Bike' with the checkkbox displayed Thank you
  6. <!DOCTYPE html><html><body> <form action="demo_form.asp" method="get"> <input type="checkbox" name="vehicle" value="Bike"> I have a bike<br> <input type="checkbox" name="vehicle" value="Car" checked="checked"> I have a car<br> <input type="submit" value="Submit"></form> </body></html>
×
×
  • Create New...