Search the Community

Showing results for tags 'checkbox'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 16 results

  1. Hi all, 1. I want to delete selected(checkbox) items from database(MySQL). Here I am not getting any error, but I couldn't do the delete function.2. Wants to play videos in website. Here videos storing into folder and also into database, but cannot playin website. I tried in many ways, but I couldn't. So, please help to make above mentioned functions workable. dashboard.php<form method="post" enctype="multipart/form-data"><input type="submit" name="delete" class="btn btn-primary" onclick="myFunction(id)" style="font-size: 15px; margin-left: 3em;" value="Delete" /></form><div><?php$query = mysqli_query($database, "SELECT * FROM video");while($row = mysqli_fetch_assoc($query)){$id = $row['id'];$name = $row['name'];$url = "../uploads";// $url = $row['url'];$fileextensionvalue= $row['fileextension'];echo "<span class='col-md-6'><div class='row'><div class='col-md-1'><label class='checkbox'><input style='margin-right:1em;' name='checkbox[<?php echo $id; ?>]' type='checkbox' id='checkbox[]' data-toggle='checkbox' /></label></div><div class='col-md-1'><a href='#' style='color:red;font-size:18px;'>$id</a></div><div class='col-md-10'><a href='#' style='color:red;font-size:18px;'>$name</a></div></div><center style='padding:25px;'><video width='320' preload='auto' controls><source src='$url' type='video/$fileextensionvalue;codecs='avc1.42E01E, mp4a.40.2, H.264, aac, FLAC, Opus, VP9, VP8, Vorbis''/></video></center></span>";}?></div><script type="text/javascript">function myFunction(id){var r=confirm("Are you sure to delete selected video/s ?");if(r==true){window.location.assign("deleteVideo.php?id=" + id);}}</script>deleteVideo.php<?phpinclude '../database/database.php';$sql = mysqli_query($database, "SELECT * FROM video WHERE id='$id'");if(empty($_POST['delete'])){Print '<script>alert("Please choose file/s to delete.");</script>';Print '<script>window.location.assign("dashboard.php");</script>';}else if(!empty($_POST['delete'])){foreach($_POST['checkbox'] as $id => $val){if($val=='checked'){$query=mysqli_query("DELETE FROM video WHERE id = '".$id."'");$result= mysqli_query($database, $query) or die("Invalid query");}}}?>
  2. For option buttons, when we click on labels, the option buttons should be selected. In order to achieve this, We need to put input inside labels. For example instead of write this: <input class="w3-check" type="checkbox" checked="checked"> <label>Milk</label> We should write this: <label> <input class="w3-check" type="checkbox" checked="checked"> Milk</label> Now when we click on CheckBox's label the checkbox gets checked. This is the same for option button. We can change this in html tutorials and w3.css tutorials too. like here. Again thanks a lot for fantastic website. I've learned everything about web, First from W3Schools. Chears.
  3. Hi I would like to customize a specific toggle slider. I managed to make the example larger, but now the toggle moves only a little and not across the entire switch. ( I set width to 160 in the .switch class) example: <!DOCTYPE html> <html> <head> <style> .switch { position: relative; display: inline-block; width: 160px; height: 34px; } .switch input {display:none;} .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; -webkit-transition: .4s; transition: .4s; } .slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; -webkit-transition: .4s; transition: .4s; } input:checked + .slider { background-color: #2196F3; } input:focus + .slider { box-shadow: 0 0 1px #2196F3; } input:checked + .slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px); } /* Rounded sliders */ .slider.round { border-radius: 34px; } .slider.round:before { border-radius: 50%; } </style> </head> <body bgcolor='teal'> <center><br><br> <h2>Toggle Switch</h2> <label class="switch"> <input type="checkbox"> <div class="slider"> Tekst</div> </label> <br><br> </center> </body> </html> So anyone any suggestions how to slide the toggle over the entire switch?
  4. Hi everyone I am trying to create the one table columns (I will do multiply columns later) with checkbox, it is good for people who show up for meeting or activity. I am trying to make a check that post in next below from checking chart, but it won't post at all, what did i do wrong? Can you help me? Thanks, Gary </table></fieldset></form><h2>Checbox works with database</h2><form action="portfolio.php" method="POST"><table><?php $list = "SELECT ID, FirstName, LastName FROM sample";$list2 = mysqli_query($connect, $list); if (mysqli_num_rows($list2)) {while ($row5 = mysqli_fetch_assoc($list2)) {echo "<tr><td>".$row5['FirstName']."</td><td>".$row5['LastName']."</td><td><input type='checkbox' value='".$row5['ID']."' name='check'></td></tr>";}}?><tr><td colspan="3"><input type="submit" name="check3" value="who showed up"></td></tr></table><table><?php if ($_POST['check3']) {$check = $_POST['check']; if ($check) {$select = "SELECT FirstName, LastName FROM sample WHERE = ID '%".$check."%'";$run = mysqli_query($connect, $select); if (mysqli_num_rows($run)) {while ($ran = mysqli_fetch_assoc($run)) {echo "<table>";echo "<tr><td>".$ran."</td></tr>";echo "<table>";}}}}?></table></form>
  5. Hi Sir/Ma'am,Good day!I made a checkbox and I use jquery on displaying one textbox if the user check the Yes checkbox but if the user check the no the textbox will be hide. It works fine now but when the checkbox has vale from the database and which is no the textbox was displayed so that I made a if condition that only if the checkbox is Yes or '' but I noticed that when I check the Yes the textbox was not display because from the database the value of textbox is No. $(document).ready(function() {$(".ticket").change(function () { //check if its checked. If checked move inside and check for others value if (this.checked && this.value === "Yes") { //add a text box next to it $("#destination_data").show(); } else if (this.checked && this.value === "No") { //remove if unchecked $("#destination_data").hide(); } });});if($ticket == ''){?> #destination_data {display: none; display:}<?php}?> <tr> <td class="row_leaveform">Travel Tickets:</td> <td class="row_leavedata"> <input type="checkbox" class="ticket" name="ticket" value="Yes" <?php if($ticket=="Yes") echo 'checked="checked"'; ?>>Yes <input type="checkbox" class="ticket" name="ticket" value="No" <?php if($ticket=="No") echo 'checked="checked"'; ?>>No </td> </tr> <tr id="destination_data"> <?php if($ticket=="Yes" || $ticket=='') { ?> <td class="row_leaveform">Destination </td> <td class="row_leavedata"><b>Doha</b> to <input type="text" name="destination" id="destination" value="<?php echo $nationality; ?>" size="31"></td> <?php } ?> </tr>it works fine when $ticket == '';but when in terms of update and the $ticket has value of Noin this code the destination was not display but when I try to check the Yes the destination was not display. I want it to display once I click the Yes if need to update my data.if my remove the if condition even the value of ticket is No the destination was display :(I want to happen is if$ticket == '' or $ticket == 'Yes' the destination display$ticket == 'No' destination not display but when I click the Yes the destination should be displayThank you.
  6. Can someone give an example of a php script that lets a form with checkbox input choose between 2 different pages when it is checked or not. Actually the dilemma is that the action attribute is sending form data to another pages (2 pages) - but dont know what code to use - . So if the checkbox isnt checked a third page should load in the browser.
  7. Hi Sir, I creating a form with checkbox for example I checked the Add Employee and Upload Employee, after I click the Submit button the output is 2 and 3 which is correct but only the Upload Employee was checked. How can it be that the Add Employee and Upload Employee was checked. Also how can save checkbox check in the database. if(isset($_POST['submit'])){ if(!empty($_POST['access'])) { $access = $_POST['access']; echo "You chose the following color(s): <br>"; foreach ($access as $access_id){ echo $access_id."<br />"; }} // end brace for if(isset else { echo "You did not choose a color."; }}<input type="checkbox" name="access[]" id="access" value="1" <?php if($access_id==1) echo 'checked="checked"'; ?>>Search/View Employee Information<br><input type="checkbox" name="access[]" id="access" value="2" <?php if($access_id==2) echo 'checked="checked"'; ?>>Add Employee<br><input type="checkbox" name="access[]" id="access" value="3" <?php if($access_id==3) echo 'checked="checked"'; ?>>Upload Employee<br><input type="checkbox" name="access[]" id="access" value="4" <?php if($access_id==4) echo 'checked="checked"'; ?>>Permission<br><input type="checkbox" name="access[]" id="access" value="5" <?php if($access_id==5) echo 'checked="checked"'; ?>>Vacation<br><input type="checkbox" name="access[]" id="access" value="6" <?php if($access_id==6) echo 'checked="checked"'; ?>>Calendar Event<br> <input type="submit" name="submit" id="submit" value="Submit"> Thank youHi Sir,I creating a form with checkboxfor example I checked the Add Employee and Upload Employee, after I click the Submit button the output is 2 and 3 which is correct but only the Upload Employee was checked.How can it be that the Add Employee and Upload Employee was checked.Also how can save checkbox check in the database. if(isset($_POST['submit'])){ if(!empty($_POST['access'])) { $access = $_POST['access']; echo "You chose the following color(s): <br>"; foreach ($access as $access_id){ echo $access_id."<br />"; }} // end brace for if(isset else { echo "You did not choose a color."; }}<input type="checkbox" name="access[]" id="access" value="1" <?php if($access_id==1) echo 'checked="checked"'; ?>>Search/View Employee Information<br><input type="checkbox" name="access[]" id="access" value="2" <?php if($access_id==2) echo 'checked="checked"'; ?>>Add Employee<br><input type="checkbox" name="access[]" id="access" value="3" <?php if($access_id==3) echo 'checked="checked"'; ?>>Upload Employee<br><input type="checkbox" name="access[]" id="access" value="4" <?php if($access_id==4) echo 'checked="checked"'; ?>>Permission<br><input type="checkbox" name="access[]" id="access" value="5" <?php if($access_id==5) echo 'checked="checked"'; ?>>Vacation<br><input type="checkbox" name="access[]" id="access" value="6" <?php if($access_id==6) echo 'checked="checked"'; ?>>Calendar Event<br> <input type="submit" name="submit" id="submit" value="Submit"> Thank you
  8. I'm in the final stretch of this project. It 1) takes data from a server-side SQL database using php; 2) generates and saves a xml file to the server; and 3) uses a xsl transform and word template document along with the previously generated xml file to generate a word 2010 document which is pushed out to the client. I've been able to get the word document working just fine for all of the text fields but am having trouble with the checkbox. I want to be able to check or leave un-checked a checkbox in the word template document based upon a value in the xml file. The relevant xslt code section is: <w:checkBox><w:sizeAuto/><w:default w:val="0"/></w:checkBox> If I could change the default "val" from "0" to "1" based upon the content of the xml file, that would make the change I'm looking for. I've already written code to create a "0" or "1" in the relevant location on my xml file. All I need to know is how to change the xsl transform code based upon a "0" or "1" value in the xml file. Any suggestions would be welcomed.
  9. Hi All, How can I replace the "Non-recurring default script" with "Recurring script" buttons when the checkbox is checked? I can only go this far: http://jsfiddle.net/k53nv/ Buttons sample: Non-recurring script (default): <script type="text/javascript" src="https://03a4d20.netsolstores.com/add-a-store.aspx?pid=4&lid=8"></script>Recurring script: <script type="text/javascript" src="https://03a4d20.netsolstores.com/add-a-store.aspx?pid=1&lid=8"></script> I need to drop the full HTML code/script to my WordPress website. Thank you in advance.
  10. Hello, new here and also sorta new to PHP and all that. I'm trying to find a way to select certain checkboxes and input that data into a database. And then at times go back and view and update the database. The checkboxes may also change at times and I do not want to go add a bunch of fields into the database just to see who's all in it. What I have so far is peoples names in a checkbox form where I can select names and submit it. It then implodes and inserts it into the database like so responders(2,4,47,56) Its not going to be a thing like responders(0,0,1,0) type thing. My format so I do not confuse people responders = row in mysql (numbers) = data in the field in my row Am I way overthinking this, or is there a very simple way to do this? Please note, the name list may update in the future as in names being added, I would like an easy way to add people without killing myself modifying my php/html files. If I lost you in anyway let me know I will see what I can do to make it not confusing.
  11. I'm hoping somebody will be able to set me on the right path to making my code simpler, and I hope my description will suffice. Here is my query: When I use many checkboxes on a page, I'd like to know if there is a way to make the array so that I only need to specify the 'true' values, and have a blanket for all other boxes to be 'false'. In this following example it is easy to get the desired result to get 'message 1' when boxes 1 and 4 are checked, but 2 and 3 remain unchecked; and also 'message 2' then boxes 1, 2 and 4 are checked but box 3 remains unchecked, and then 'message 3' for all other combinations: { if(cb[1].checked==true&&cb[2].checked==false&&cb[3].checked==false&&cb[4].checked==true) { alert('message' 1); } else if(cb[1].checked==true&&cb[2].checked==true&&cb[3].checked==false&&cb[4].checked==true) {alert('message' 2); } else { alert('message 3'); } } But if I have 12 boxes, with a very large total of possible combinations, it would be impractical to use that string, as I need to specify the majority of combinations. And if I simply use: { if(cb[1].checked==true&&cb[4].checked==true) { alert('message' 1); } else { alert('message 3'); } } then the user gets 'message 1' even if he checks, say, box 5 along with boxes 1 and 4. So, I'd like to know if there is a way to require 'all other boxes' to be unchecked. Thanks in advance for any ideas.
  12. I am using checkboxes to select specific criteria to use within a MySQL query string. In my case, as long as the checkboxes do not change, I want to keep the previously selected checkbox values, and pass them on to any additional page sorting that's done after the initial checkbox selection process. I'm already initializing my MySQL query string successfully, using these checkboxes. But, once I have the data set that I want to work with, I need the ability to re-sort the columns, or refresh the page, based on my initial selection criteria. But, I have not been able to get the initially selected criteria to "persist", when I sort the columns, after the select has finished. How can I take the incoming variables, and make them persistent? How can I take the incoming variables, and pass them to the sort process? Thanks in advance. JCF
  13. I am trying to make a checkbox work with a label which is INSIDE an <a href> ..,the label function isn't working because of both the separate <div> in which it appears and also because of the anchors. Is there are work-around for this? Can I 'hard code' the labels with css or jscript so that they will work universally throughout the page? Easier if I just post the code rather than trying to explain: <div id="blah"><input type="checkbox" id="1" checked onclick="fnchecked(this.checked);"> <ul class="menu collapsible"> <li> <a href="#"> <div class="more"><label for="1">[+]</label></div> <div class="less"><label for="1">[–]</label></div> </a> <ul class="acitem"> <BR> <li>TEXT TEXT TEXT </li> </ul></li></ul> The page I am using this with is here: http://www.paulclift.net/news.htmlBasically, I am trying to have a plus/minus symbol which ALSO activates a drop-down menu. PLEASE HELP!
  14. <html><head><title>Korean Language School</title><script type="text/javascript"> function apply() { document.frm.sub.disabled = true; if (document.frm.chk.checked == true) { document.frm.sub.disabled = false; } if (document.frm.chk.checked == false) { document.frm.sub.enabled = false; } }</script></head><body><form id="apply" action="" name="frm"> <fieldset> <legend>Customer Information</legend> <dl> <dt><label for="name">Name</label></dt> <dd><input type="text" placeholder="First & Last Name" required="required" id="name"/></dd> </dl> <dl> <dt><label for="email">Email</label></dt> <dd><input type="email" placeholder="asklc@hotmail.com" required="required" id="email"/></dd> </dl> <dl> <dt><label for="gender">Gender</label></dt> <dd><input type="radio" name="gender"/>Male <input type="radio" name="gender"/> Female</dd> </dl> <dl> <dt><label for="contact">Contact Details</label></dt> <dd><input type="text" value="+65" required="required" id="contact"/></dd> </dl> <dl> <dt><label for="Ask">Have you learnt Korean Before?</label></dt> <dd><input type="radio" name="Ask" />Yes <input type="radio" name="Ask" />No</dd> </dl> </fieldset> <fieldset> <legend>Class Information</legend> <dl> <dt><label for="Course">Which Course Are you taking?</label></dt> <dd><input type="radio" name="course" />Basic Course<br /><input type="radio" name="course" />Intermediate Course<br /><input type="radio" name="course" />Advanced Course</dd> </dl> <dl> <dt><label for="frequency">How often will you like the class to be?</label></dt> <dd><input type="radio" name="freq" />Twice a week<br /><input type="radio" name="freq" />Once a Week<br /><input type="radio" name="freq" />Once Every 2 Weeks</dd> </dl> <dl> <dt><label for="time">What days do you prefer your lesson to be?</label></dt> <dd><input type="checkbox" name="time" />Weekday<br /><input type="checkbox" name="time" />Saturday<br /><input type="checkbox" name="time" />Sunday</dd> </dl> <dl> <dt></dt> <dd style="padding-left: 100px;">I have agree to the <a href="#">Terms & Condition</a> <input type="checkbox" name="chk" onClick="apply()"></dd> </dl> <dl> <dt></dt> <dd><input type="button" name="sub" value=" Submit " disabled="disabled" onclick="submit()"><input type="reset" value=" Reset "/></dd> </dl> </fieldset> </form> I got my Javascript from a site [sorry, i've forgotten where] When i click on my " I have agree to the Terms & Condition " checkbox, my submit button becomes clickable again. However, when i tried this, <script type="text/javascript"> function apply() { document.frm.sub.disabled = true; if (document.frm.chk.checked == true && document.frm.course.checked== true && document.frm.freq.checked == true && document.frm.time.checked == true) { document.frm.sub.disabled = false; } if (document.frm.chk.checked == false && document.frm.course.checked == false && document.frm.freq.checked == false && document.frm.time.checked == false) { document.frm.sub.enabled = false; } }</script> No matter what i have checked, the submit button stays "Disabled" all the time.
  15. Is there anyway to make the edges curved as opposed to being sharp? When I say edges, I mean the edge of a div, not a checkbox. Can you style a checkbox? Like change the color of the checkbox to something as opposed to its normal white background. I only want the checkbox to change color and not the whole input. The two questions above are not related.
  16. i have<input name="submit" value="submit" type="submit" onclick="control()"> and need to check that 7 check boxes have been check before the form has been posted how would i write the java script for this?