Hi All, I have a PHP code to display table data with a column of checkboxes used to click to mark the test case as Blocked. I am trying to save the state of checkbox after it is submitted, but I am unable to do so. Please help! echo "<form id =\"blockform\" method=\"post\" action=\"\">"; echo "<form id=\"checkbox\" class=\"check2\" method = \"post\">"; $checked = ""; if(isset($_POST['Blocked[]'])) { $checked = 'checked="checked"'; } echo "<td $Blocked><input type =\"checkbox\" name=\"Blocked[]\" value=\"checkblock\" onclick=\"showMsg('div1')\" $checked/></td>"; echo "<input type=\"submit\" value=\"Submit\" class=\"button\" name=\"edit_tc\" onclick=\"myFunction(form)\" style=\"position:fixed; height:25px ; width:150px; bottom:25px; right:200px;\"/>"; echo "</form>"; echo "</form>";

Member Avatar
Member Avatar
+0 forum 5

I've trying to figure out how to do this, but errors didn't stop flooding me. The following code works fine: For i = 1 To 50 Me.Controls("CheckBox" & i).Visible = True Next i But when I modify it to: For i = 1 To 50 Me.Controls("CheckBox" & i).Checked = False Next i I have even tried to mofify it to: For i = 1 To 50 System.Windows.Forms.CheckBox("CheckBox" & i).Checked = False Next i But the error still exsists. How would I fix this?

Member Avatar
Member Avatar
+0 forum 4

Hi,I am a beginner in php. And I am trying to create this php program where a user selects a picture and it displays it! Theare is an input page which is html and an processing page which is php! I seemes to have a problem in the processing page of the program.The problem is on line 22 in the processing page and it relates to escape character. How do I fix my issue please help I alredy spend more the several hours on it and still can't figure it out! Here are the code for the processing page: The …

Member Avatar
Member Avatar
+0 forum 1

i already searched about displaying the data fields, my problem is how to retain the checked item and then set its value as 1. please help. i tried some code but didn't work: <html> <form action='' method='post'> <?php $database = 'sample'; $table = 'checklist_stud_columns'; $mysql = mysql_connect('localhost', 'root', '') or die(mysql_error()); mysql_select_db('sample', $mysql) or die(mysql_error($mysql)); // selecting db is not not necessary in this case $query = sprintf(" SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s' ", mysql_real_escape_string($database), mysql_real_escape_string($table) ); $result = mysql_query($query, $mysql) or die(mysql_error($mysql)); while( false!=($row=mysql_fetch_array($result)) ) { $name = htmlspecialchars($row['COLUMN_NAME']); printf("<input type=\"checkbox\" name=\"col[]\" …

Member Avatar
Member Avatar
+0 forum 3

hello folks I'm a greenhorn in PHP so excuse me if i'm being dumb. I have set up a page that is pulling records out of a database table, the user viewing the page is intended the choose a number of the records on the page (using checkboxes) and download as CSV to use for referencing.The problem is that i dont know the technique to do this. the code looks like this <?php include 'data.php'; try{ $con = new PDO('mysql:host=localhost;dbname=abc', $user, $pass); $con->SetAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql=$con->prepare('select id, title, author, secondary_title, year, volume, number, pages from refs'); $sql->execute(); $sql->setFetchMode(PDO::FETCH_ASSOC);?> <!doctype html> …

Member Avatar
Member Avatar
+0 forum 11

Good Morning, I am after some help, I am still fairly new to php development so apologies if this one has been answered before, I have been tasked to build an email migration tracker that automates emails, this part I think I have covered, one part I am not sure with and would love some guidance is the form has checkboxes (check list) which when they are ticked I need the current date to be populated in the textbox next to them, in the correct date format, is there any way in php this can be done, any advice would …

Member Avatar
Member Avatar
+0 forum 8

Hi I'm trying to complete this assignment and I don't understand how this PHP thing works. I can't get the value of the check box to populate and I can't get the sales tax to calculate either. He is what I have so far: <!DOCTYPE html> <!-- testproblem.html --> <html lang = "en"> <head> <title> Light Bulb Exercise </title> <style type = "text/css"> td, th, table {border: thin solid black;} </style> </head> <body> <form action = "http://localhost:8888/mikeswork/testproblem.php" method = "post"> <h2> Light Bulb Convenient Store </h2> <table> <!-- Text widgets for the customer's name and address --> <tr> <td> Name: …

Member Avatar
Member Avatar
+0 forum 12

How do you create lists in an APEX form which allow many checkbox selections? How do you store these in database?

Member Avatar
Member Avatar
+0 forum 1

hello, i'm having trouble getting my delete selected checkbox working for a code I'm writing: the trouble is really just in the bottom half of the code after i make the while loop...i made this off of an example that i found on a site but like it was pretty clear that the site's code had many errors for example...the coder made an input tag and later called it as a $variable which i'm pretty sure isn't possible..anyways some help would be much appreciated :) <?php //create a database connection mysql_connect("localhost", "root","") or die(mysql_error()); //select your database mysql_select_db("group1"); ?> <html> …

Member Avatar
Member Avatar
+0 forum 14

hi friends, here is my problem i'm designing a page with no. of checkboxes but not able to insert its value in mysql... here is my php code: **<?php $host="host"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="packtest"; // Database name $tbl_name="test"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Get values from form $user_id=mysql_real_escape_string($_POST['user_id']); $granules=mysql_real_escape_string($_POST['granules']); $master_batch=mysql_real_escape_string($_POST['master_batch']); $fmcg application=mysql_real_escape_string($_POST['fmcg application']); $pharma application=mysql_real_escape_string($_POST['pharma application']); $pvc films=mysql_real_escape_string($_POST['pet films']); $pe films=mysql_real_escape_string($_POST['pe films']); $pp films=mysql_real_escape_string($_POST['pp films']); $pre formed pouches=mysql_real_escape_string($_POST['pre formed pouches']); $pet containers=mysql_real_escape_string($_POST['pet containers']); $pp containers=mysql_real_escape_string($_POST['pp containers']); $hdpe …

Member Avatar
Member Avatar
+0 forum 19

I Need to to update multiple checkbox values on multiple records at the same time. When the form loads, it should display the sizes already selected for each style as stored in the style table and if we select or deselect any sizes on a style it should update the sizes field with the appropriate all the sizes checked. THE MySQL DATABASE [CODE] -- -- Table structure for table `style` -- CREATE TABLE IF NOT EXISTS `style` ( `id` mediumint(8) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `colour` varchar(255) NOT NULL, `sizes` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB …

Member Avatar
Member Avatar
+0 forum 7

I have a grid view with a check box column i want to open a new window when clicked on that check box . How can i do that? please help, thanks in advance

Member Avatar
Member Avatar
+0 forum 2

Hello everyone, I'm working on adding checkboxes to the edit_profile section where members should be able choose with checkboxes the multiple options of massage techniques offered... When I checked only one, either, option 1, or option 2 or option 3 I'm able to see it in the column in the correct table of mysql but when I check more then one box only the last box would insert into the column, ignoring the rest. In this case, if I check the three options, only lomi lomi would insert into the column... I hope you guys can help me. Here is …

Member Avatar
Member Avatar
-1 forum 4

With the code below I have the plant information printing out first and then all of the availability printing out last. Is there any way I can get both printing together, but not have duplicate pictures and information for the numerous sizes that sometimes list per plant. Ex. Buxus Green Velvet may have quantities for 3 gallon, 5 gallon, 24-30 inch, etc. I do not need the plant info and pictures printing out for each of these sizes. I just want the size and availability listed together under the ONE picture and info. Thanks for any assistance you can provide …

Member Avatar
Member Avatar
+0 forum 6

Hello, im trying to do a single html page with multiple checkboxes to hide/show text when checked/unchecked. I'm really bad at html but so far I have got this: The problem I have is I dont know how to add more checkboxes. Would appreciate some help. [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>101st</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> function setCookie(isName,nState){ var currState = nState ? '1' : '0'; document.cookie = isName+"="+currState; nState ? document.getElementById('toggleDiv').style.display = '' : document.getElementById('toggleDiv').style.display = 'none'; } function getCookie(isName){ var cookieStr = document.cookie; var startSlice = cookieStr.indexOf(isName+"="); if (startSlice == -1){return …

Member Avatar
Member Avatar
+0 forum 2

I have a form with checkboxes [CODE]<input type="checkbox" name="yo[1]" value=1 <input type="checkbox" name="yo[2]" value=1 <input type="checkbox" name="yo[3]" value=1[/CODE] I want to to insert values into db exactly like this create table tablename yo1 tinyint default 0 , yo2 tinyint default 0, yo3 tinyint default 0 insert into table set yo1=value, yo2=value, yo3=value How do I do that? (dont want to loop/implode yo[]) /total newbie hoping for some help

Member Avatar
Member Avatar
+0 forum 8

Hey, I am creating a website with two forms which contain checkboxes and displays and sends the values input by the user to display on the page as well as save onto a database. The languages I'm using are xhtml, php and sql. The problem for me is that only one (usually the first value) sends over to the database if say for instance I select 3 checkboxes, what I need is for all the values to send over Here is the coding. Note: I've done alot of trial and error and nothing seems to be working for me. I …

Member Avatar
Member Avatar
+0 forum 5

Three files. A simple contact form. I am trying to get checkboxes & dropdowns to work, but so far, only (1) dropdown works, and after going at it for hours, have found no error in the <form> itself. Not a PHP genius, so maybe it has something to do with that..? Thanks in advance! An answer ASAP would be most greatly appreciated! [B]contact.php[/B] [CODE] <form method="post" action="contactengine.php"> <table> <tr> <td class="left"><label for="Name">Name:</label></td> <td><input type="text" name="Name" /></td> </tr> <tr> <td class="left"><label for="State">State:</label></td> <td><select name="State" size="1"> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> …

Member Avatar
Member Avatar
+0 forum 6

the problem here is When I check 1 checkbox there's no mysql error but if the checked checkboxes are more than 1 then an error occurs. it only takes the first but the following checkboxes occurs an error. the code can be downloaded here. the file of the problem is get_value.php [URL="https://skydrive.live.com/embedicon.aspx/.Public/CLC.zip?cid=3e21e1e16478087a&sc=documents"]https://skydrive.live.com/embedicon.aspx/.Public/CLC.zip?cid=3e21e1e16478087a&sc=documents[/URL] please help me out getting all the values of all checked checkboxes. in my program.... the first in the list was taken by the process but the succeedig checkboxes occurs an error. pleast tell me here the correct code of the program

Member Avatar
Member Avatar
+0 forum 8

Hi there guys I need some help I can't seem to remove the checks in the check list boxes i used checklistbox1.clearselected(); for my reset button but it didn't work. It does not remove the checks inside the boxes. I have an attachment you can use as your reference. Thank you for those who will help.

Member Avatar
Member Avatar
+0 forum 2

body.php [code=php] <html> <head> <script type="text/javascript"> function showUser(str, query) { if(document.getElementById("Author").checked==true) { query="author"; }else if(document.getElementById("bookname").checked==true) { query="bookname"; }else{ document.getElementById("textHint")="please select"; } if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","postback.php?q="+str+"&query_type="+query,false); //xmlhttp.open("POST","postback.php",false); xmlhttp.send(); } </script><title> Search Books </title> </head> <body> <form method ="GET" > <div style="background-color:Orange" align="left"> <h3>Welcome<label name="name"><?php /*require('validation.php');*/ echo $_GET['uname'].", "; ?></label>Want to search a book?</h3> Search:<input type="text" name="users" onKeyUp="showUser(this.value)"/><br/> Search By<br/> Author<input type="radio" name="query_type" id="Author" onClick="showUser()" checked="checked" style="color: …

Member Avatar
+0 forum 0

I have assigned the value whether the check box is ticked or not to a vairable.I want to pass the value to a function. how do I do that ? if (checkbox1.checked==true) { value1 = "I am here" } if (checkbox2.checked==true) { value2="I am there" } value3 = value1 + value2 function (value3) { ..... } thee b problem is value 1 and value 2 are out of scope for value 3 ?what should I do ?

Member Avatar
Member Avatar
+0 forum 2

Hi, I have a situation that is producing NULL values: The situation is best explained with this code at this link: [CODE]http://www.daniweb.com/web-development/php/threads/227698[/CODE] Initially, I had a link called "add to list" for each record the display page displayed. I used to hide the row-id in there and pass it onto the next page for processing. Now, with multiple items displayed as rows, one after the other, I am supposed to put the quantity that the user wants to order and check the checkbox next to it. After doing this with several other items, the user click on a link that …

Member Avatar
Member Avatar
+0 forum 1

I am trying to create a PHP code for restaurants - I need the check boxes on the UI to allow for options for example the title would be "select up to three toppings" and there would be a list of checkboxes and the User can only check three also, same check-boxes, but now unlimited from a list (like building a pizza) the toppings are the list with the check boxes next to each Subitem (toppings) and the price needs to be added as well

Member Avatar
Member Avatar
+0 forum 1

I hate to post a thread on this since I know this topic has been discussed ad nauseum, but I've been searching for weeks and cannot find exactly the answer I've been looking for. I'm new to arrays and loops - I get the concept, but not the syntax. Here's my conundrum: I have a list of email contacts in my DB (MySQL). I can query the DB, list every contact that has opted in, it displays as desired on my screen, I can put in an email address as "from", a message and upload an image and I can …

Member Avatar
Member Avatar
+0 forum 7

I am 4 months new to PHP! So please be gentle with me. : ) I have an input form that contains check-boxes(it works and posts array to database correctly!) I have an update form that contains the same check-boxes (it updates and posts array to database correctly BUT IT DOESN'T CORRECTLY DISPLAY database info in the checkboxes!) The Problem is: I cannot get the update form to correctly display "the check-box array" from the database" It only displays the LAST unit in each array!?!?!?!?!? Here is my php code to pull the array from the database in a while …

Member Avatar
Member Avatar
+0 forum 2

I am designing a lot of TCheckBox at runtime, and uses mathematical formulas for placing these in columns and rows afterwards on a form. I assign an on click event that is exactly the same on all of them, and everything work, except... Color. My OnClick event is made like this: [CODE] procedure TForm1.CheckBoxClicked(sender: TObject) ; begin if Sender is TCheckBox then begin WITH TCheckBox(Sender) DO BEGIN IF Color=clBtnFace THEN BEGIN Caption:='TESTER 1'; TCheckBox(Sender). Color:=clGreen; TCheckBox(Sender).Font.Color:=clGreen; Checked:=TRUE; END ELSE IF Color=clGreen THEN BEGIN Caption:='TESTER 2'; Color:=clRed; Font.Color:=Color; Checked:=TRUE; END ELSE IF Color=clRed THEN BEGIN Caption:='TESTER 3'; Color:=clBtnFace; Font.Color:=Color; Checked:=FALSE; END …

Member Avatar
Member Avatar
+0 forum 4

Hi, I am working on a refined search feature and I am having a little problem with the following code. I'm trying to get the "genre" values from the form. Then use them in a query to refine the results from the database. The problem is as follows. I need "$str" to pass the values from the form like this: AND genre IN ('other','metal','pop')'; But, with multiple selected boxes "$str" passes them like this: AND genre IN ('other,metal,pop')'; Any help would be great! SIDE NOTE:If one checkbox is selected, it works fine. [CODE] <? if(isset($_REQUEST['submit'])) { $str = ' 1=1 …

Member Avatar
Member Avatar
+0 forum 3

So I got help from here earlier with one problem and a few more have arisen, the biggest is for some reason my checkbox and dropdown array won't store the data and when it's supposed to check to verify there is at least 1 selected of each nothing happens... To be honest the ideal thing would be to have it check to see if the drop down size selection below the checkbox was selected, but I'll do whatever as long as it works. Thanks ahead of time for the help. Here's my page code: [code] <html> <HEAD> </head> <body> <?php …

Member Avatar
+0 forum 0

[CODE] <asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate> <table border="1" width="100%"> <tr> <th>id</th> <th align=left>Room Categories</th> <th>single</th> <th>Double</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td width="5%"> <asp:Label ID="Label3" runat="server" Text= '<%# Container.DataItem("packageid")%>' /></td> <td> <asp:CheckBox ID="chk_packages" AutoPostBack=true runat="server" Text = <%#Container.DataItem("package_name")%> /> </td> <td><%#Container.DataItem("single_rate")%><asp:CheckBox AutoPostBack=true ID="single" Enabled=false runat="server" /></td> <td><%#Container.DataItem("double_rate")%><asp:CheckBox AutoPostBack=true ID="Double" runat="server" /></td> <td><asp:Label ID="Label2" runat="server" Text="Label"></asp:Label></td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> </asp:PlaceHolder>[/CODE] i want when any packages checbox click in repeater two other checkbox in repeater (single,double get enable) in the same row ,whne i un-unchecked it it also disables them , iw rite some stuff in my application in order to …

Member Avatar
+0 forum 0

The End.