Multiple Tick-box Select

Mar 9, 2007

I have a list and what I would like to do with this list is have a tick-box next to each one, so someone can select multiple things out of the list. Then, once they click "submit", it displays just the things they selected.

The list in the data is displayed from a database by repeating the rows, so if there are 3 rows, it displays it in a table repeating the <tr><td><?=$thing?></td></tr> until it ends.

I know how to do forms, just not how to post only the selected data, to display it on a different page.

ADVERTISEMENT

Tick Box, Select And Update Database.

Apr 3, 2007

I am trying to change the value in table with a tick box. If the tick box is selected it changes the value in the field to 'y' and if it is not selected it changes the field to 'n'.

First of all I need to bring back the current state of the field and then I need to be able to update it from 'y' to 'n' as many times as I want. Code:

View 1 Replies View Related

Multiple Select From Listbox And Execute A Sql Query Select Statement

Sep 23, 2003

Supposing i have a html form with 2 listbox and i name it status and resolution.

So it goes <select name='status[]'>... <select name='resolution[]'>

Then i have a another php page.
$status = $_POST['status'];
$resolution = $_POST['resolution'];

Now my question is, how do i do the sql query statement?

mysql_query("SELECT * from bugs where status=$status and resolution=$resolution");

The problem is, i select 3 options form the status listbox eg. new, closed, duplicate. And from the resolution, i chose fixed, invalid.

View 2 Replies View Related

Tick Function?

Jul 17, 2005

Just out of curiousity, has anyone successfuly use tick functions in one of
their scripts?

View 1 Replies View Related

Tick All Checkboxes

Feb 8, 2006

I have a set of 4 checkboxes and I want to have a button that will check all
the boxes. I have looked on Google but can only find examples of it being in
Javascript. Is there any way of doing it in a php file. If not, how do I go
about using a Javascript file? Do I have to make a reference to it in the
php?

View 5 Replies View Related

Select One Checkbox Instead Of Select Multiple Checkboxes?

Nov 11, 2009

i want to select only parent checkbox. then automatically check all child checkboxes. i mean checkall checkboxes at once. using javascript

<SCRIPT LANGUAGE = "JavaScript">
<!--
function modify_boxes(to_be_checked,total_boxes){[code]...

it does not working.

View 2 Replies View Related

Write To A Page Dependant On Tick Box Value

Apr 23, 2004

what im trying to do is write something to a page dependant on what box's are ticked

i know how to write to a page using fopen & fwrite

but i dont know how to make it dependant on the tick boxes:

View 1 Replies View Related

Storing Tick Boxes In MySQL

Aug 12, 2004

I am trying to work somethng out. For each record there is a number of tick boxes which may or may not be ticked. Clearly a flat file would be easiest with a table of 1/0 but that seems like a bit of a waste of space. How would you store such info

MAIN
id {PK}
otherFeilds

TICKBOXES
id {FK}
tickBoxId (FK}

TICKBOXTYPES
tickBoxId {PK}
type

Then group by each main ID and get the corresponding tick box types.

View 1 Replies View Related

How Can I Tick A Radio Button And On Clicking It Update A Database.

Aug 13, 2006

How can i tick a radio button and on clicking it update a database.

View 2 Replies View Related

If Tick Box Ticked Force Completion Of Text Area?

Jun 16, 2011

I have created a php form on the form there is a field called "alert" and I wan to set the form so that if the "alert" tick box is ticked them the user must enter a comment why they ticked the alert box.Here is the code I have

if (empty($_POST['tutorComment']) && $_POST['alert'] == 'YES') {
echo "You must enter a comment on the student if you tick the alert box";
[code].....

View 2 Replies View Related

Insert Multiple Records From Multiple Select?

Mar 10, 2009

I'm trying to figure out how to insert multiple records from multiple select. Lets say that 3 users are selected, then I want to create a records for each user, but how do I do that? This is my multiple form:

PHP Code:

<?
echo'<formaction="do_add.php"method="get"name="Form1">
<selectname="Multiple1"multiple>';

[code]....

View 3 Replies View Related

Multiple Drop Down Menu With Multiple Select

Jul 28, 2009

My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created the problem that when I went to select the other drop down menus, the selections i made on the multiple select one would clear.

Then I had tried putting the multiple select menu last so that the selections wouldn't clear but then after clicking the submit button(and going to the next page which is supposed to display the choices), it shows nothing. No selection from the multiple select menu went through. I would prefer to do it the first way and here is my code. Assume that my item[] is already created.

<?php
//Gettheposteddata,ifany,orinitializeasnullortoday'sdate
($type=@$_POST['Type'])or$type=1;
($item=@$_POST['Item'])or$item=1;
($name=@$_POST['name'])or$name="all";
($firstdate=@$_POST['firstdate'])or$firstdate=date("ymd");
($lastdate=@$_POST['lastdate'])or$lastdate=date("ymd");
[Code]....

View 6 Replies View Related

Multiple Multiple Select Boxes

Mar 22, 2006

I'm looking to have multiple multiple-select-boxes on a page. But I
can only get the contents from the last selected value within a box,
via PHP. I've tried numerous methods. What am I doing wrong?

You can see ALL the values present in the url:
http://myserver/test.php?notify_use..._updcats=Update
e.g.......

View 2 Replies View Related

Mmorpg Style Timer - Add A Visual Countdown Based On Server Time To Show How Long The Cron Has Left To Tick?

Oct 20, 2010

I am building a mmorpg.I have two cron files that run every hour and every day(24 hrs )My question is, how can I add a visual countdown based on server time to show how long the cron has left to tick?I have tried many countdowns but most of them reset once I leave the page.So basically I need a countdown timer to show the user how long till he getts more food or whatever.

View 3 Replies View Related

Make An Email Form Send The Email To A Different Recipient Based On Radio Tick Box

Jun 2, 2009

A client has asked me to create an email form where depending on which tick box is ticked the email is sent to a different email address.

For instance:Code:I would like to know more about: [] Cars [] Trucks [] Vans When 'cars' is ticked the email is sent to 'cars@domain.com', when 'trucks' is ticked to [URL]...

Is this a fairly easy thing to do? Can someone help me on the way (bearing in mind I have very limited php skills :-)?

View 5 Replies View Related

Posting Multiple Select

Aug 19, 2003

I'm having a little problem, in my form, I have to select multiple lines in a 'select' field and post it for processing.

Now in the $_POST-variable, there is only the last selected item visible.

How can I post every selected line?

View 1 Replies View Related

Multiple Select Box Question

Jan 22, 2003

I have a list box on my page which I dynamically populate from the database. My question is, if I allow people to have multiple selections from this, how would I retreive the selections that they have made? example:- if I name the select box "Jobs", would i be able to do something like:- PHP Code:

View 3 Replies View Related

Getting Multiple Data From <select>

Feb 6, 2007

Can anyone give me a quick hint for this?

Say, I have: <SELECT NAME="opt3" SIZE="15" multiple>

Then I'd like to list the items selected...
echo $_POST["opt3"];
but this gives only the first one

how do I get the rest?

View 5 Replies View Related

List Box Multiple Select

Jul 23, 2003

I am trying to create a drop down list that permits a person to select multiple items from the list and have the results posted on a results page. I am using Dreamerweaver MX, PHP and a MYSQL database. I was able to select multiple items but only the last selected item would be displayed. I tried to modify the list box code and now it returns nothing. Code:

View 1 Replies View Related

Select Multiple & Mysql

Aug 14, 2003

What's the sql should look like to get all possible data when using multiple select,
such as: <select name="hostfield[]" multiple> PHP Code:

View 3 Replies View Related

Select Multiple Code

Feb 12, 2002

need to be able to generate a multiple select in a form using php and then write the reults to a relation table between a resource table and a look-up table..i.e.

table 1 list of resources

table 2 list of options for element in table 1

table 3 a many to many resolution table between table 1 and table 2

I can do this if only one option is select from a drop down list, code below:

PHP Code:

View 4 Replies View Related

Select Multiple Entries

Sep 30, 2005

I attach a List Box Control, on a form. It has total five values i,e

a
b
c
d
e

I want that when my page loads, then entry no.2 (b), and entry no.3(c) are selected by default. How can i do this. give me the code.

View 4 Replies View Related

Validate Multiple Select Box

Jan 26, 2006

how to validate multiple options select box in php. I have to take 2 or 3 or 5 or 20 values(total is 20) and to be inserted in database and to retrieve the same and i need to check validation for the same if any values are not selected? it should throw an error like that. for example this is a normal select box . PHP Code:

if($_POST['pid']==&#390;')
    {
            $error=true;
            $errors['pid'][]='Please Select <b>Name </b>.'
    }

View 5 Replies View Related

Multiple Selections With <select>

Sep 26, 2006

I have a simple email form that sends form data to a php script which sends the email. I use the <select> HTML element so more than one email address can be chosen. How do these two values get sent to the php script? Right now, the variable just prints one of the two selections.

View 2 Replies View Related

Multiple Select Drop-down

Jul 29, 2005

I've got a large drop down menu, that allows multiple select. I am trying to validate the form before submitting it by checking if all the required form fields are filled.

If soemthing is not entered the form refreshes and I would like to be able to keep the selections in other form fields made by ECHOing them back. Everything works fine, except the multiple select drop-down: PHP Code:

View 8 Replies View Related

[B]SELECT From Multiple Tables

Jul 20, 2005

Trying to select data from up to eight tables, with the common column being the file_id column.

Cutting the query down to just three columns I am using:

$query = "SELECT *
FROM tbl_name,
tbl_branch,
tbl_details
WHERE tbl_name.file_id = tbl_branch.file_id AND
tbl_name.file_id = tbl_details.file_id";

I'd take a guess that's this a fairly clumsly query, but the trouble I'm having is that not all the results are being listed. I gather that this is because although there are 20 file_id's in the tbl_name, not all the other tables are complete. so tbl_branch only has 15 entries, and tbl_details only 12. Is there a better way to structure the query? And can I have results appear as 'blank' if there is an entry in tbl_name but no linked entry in tbl_branch? If so. any clues?

View 1 Replies View Related

Select From Multiple Tables

Jan 11, 2004

I'd like to select data from several tables (more than 2) to show the last entries among all tables. Ex : I have 3 tables : "cd", "book" and "dvd" with "title" and "date" fields. What I want to get is something like this :

1. misery [book]
2. titanic [dvd]
3. gladiator [dvd]
4. kill bill [cd]
5. discworld [book]

number 1 being the most recent entry.

I tried " SELECT * FROM cd, book, dvd ORDER BY date LIMIT 5" but of course it doesn't work. I didn't find any solution?

View 2 Replies View Related

Select Multiple Records

May 31, 2007

I have an application that uses mysql database. Several records are retrived from the database. To enable users to select multiple records, I've used checkboxes by the side of each record. However, the checkbox does not retrieve their value from the database, neither do they update the database.

I just thought that by setting the value of the checkbox, I could determine the selected checkboxes and insert the corresponding records into the database. The selected records whose checboxes have been set are then inserted into another table. Or updated as I may also need to update some. My problem,however, is how to determine the selected records and then do multiple inserts into the database table?

View 1 Replies View Related

Validate Select Multiple

Oct 25, 2005

<select name="name[]" multiple size=3>
<option value="0">Please Select</option>
<option value="1" >Ajay</option>
<option value="2" >Suresh</option>
</select>

Please advice, How can i check that user has selected at least one name through javascript. But not the 'Please Select'.

View 2 Replies View Related

Multiple Select List Box

May 10, 2007

I have a task where I have to fetch datas from mysql and display it in the multiple select list box. I have fetched the datas and it is getting diplayed correctly in the multiple select box. I have used some thing like this.

print "<select MULTIPLE SIZE=&#396;' name='db_test[]'>";
while($row = mysql_fetch_object($handle))
{

if($num 0) /*num is number of rows*/
{
print "<option value='$row->db_name'name='$row->db_name'>".$row

View 2 Replies View Related

Multiple Select List

Nov 16, 2006

I have a form that inserts it's values into a table in a mysql database.. i also use another form to edit the contents of that table...

My problem is that i have a multipe select list ... i imploded it's values into the table like this:

$employees = implode(',',$_POST['emp_name']);

that worked fine ... but i can't figure out how to make the same values selected on my edit form's list?

View 2 Replies View Related

Multiple Select Arrays

Mar 21, 2006

$cars = $HTTP_POST_VARS['cars'];
echo "0) ".$cars[0];
echo "1) ".$cars[1];
echo "2) ".$cars[2];
echo "2) ".$cars[3];
echo "2) ".$cars[4];

echo " <td>Cars</td>
";
echo " <td bgcolor="#00CCFF">$cars;</td>
";
echo " </tr>
";

How do I present the results of a mutiple drop down neatly in HTML tag in one line as opposed to one variable.

View 1 Replies View Related

Multiple <select> Input

Jul 11, 2006

I allow my select input to have the 'multiple attribute, how do I obtain the variables it sends using PHP?

View 1 Replies View Related

Multiple Select Into Mysql

Aug 5, 2007

I want to insert multiple selection into mysql like this:

<select name="time" multiple="multiple">
<option></option>
</select>
i tried this
$arr = $_POST['position'];
foreach($arr as $position){
$time=$position;
}
.
$insert = mysql_query("insert into $table values ('NULL', '".$_POST['time']."'

but it's not work it insert into mysql just one value i want when the user ctl+click to choose more than one to insert all selected values into mysql.

View 1 Replies View Related

Select From Multiple Tables.

Jan 18, 2006

i am right in thinking that in theory you can do an sql query like: sql=select * from tbl1, tbl2, tbl3 etc...? or would you have to do it another way?

View 1 Replies View Related

Multiple Select Query

Oct 12, 2007

I'm trying to make a page where you can view all users or narrow them down by country.

The problem I'm having is selecting several countries. In other words intead of finding users from either country 1 or country 2 I want to be able to see users from countries 1,3,4,9,32. Code:

View 14 Replies View Related

SELECT MULTIPLE Only One In $_post

Aug 7, 2005

foreach($_POST as $element=>$val)
{
echo $element.'--'.$val.'<BR>'
}

Where a select multiple html field had several selected values only shows
one?? How do I get the others. php 5.1b

View 4 Replies View Related

Multiple Select Box Problems

Oct 10, 2006

I have 2 select boxes where values are passed between each other. I want to be able to post multiple values from selext box name "sel2". But when I insert the [ ] after select name the transfer between the boxes will not work. Code:

View 1 Replies View Related

How To Select Multiple Rows

Feb 10, 2006

I can't find out how to select multiple rows

SQL: SELECT pid FROM photo_photos WHERE aid=&#391;'

there are multiple rows with aid 1 so how do I get everything in an array.

View 1 Replies View Related

Multiple SELECT Values

May 28, 2005

I have a select "List" box where I am selecting multiple items by holding down CTRL.

<input name="prod_id" type="SELECT" multiple>

--SEPERATE FIELD--
<input type="hidden" value="12321" name="package_id">
^^ That Type ^^

So I am trying to add multiple rows as follows:

PHP Code:

View 1 Replies View Related

Values From Multiple Select

Jul 23, 2006

PHP Code:

//gets listing of areas for Detailed Search when doing listings search;

            $query_area_search = 'SELECT DISTINCT(a.description), a.value '
                . ' FROM areas a'
                . ' WHERE a.value NOT LIKE &#390;''
                . ' GROUP BY a.description'
                . ' ORDER BY a.description ASC'
            $result_area_search = mysql_query($query_area_search);
while ($row_area_search = mysql_fetch_array($result_area_search)) {
                echo "<option value="".$row_area_search['value'].""";
                    if ($row_area_search['value'] == $_POST['areas']) {
                        //$selected = " selected ";
                        echo " selected";                    }
                echo ">".$row_area_search['description']."</option>

View 8 Replies View Related

Select Multiple Fields With Same Name?

Jul 19, 2011

I have a select statement for example:

SQL Code:
SELECT table1.id, name, table2.id, branch
FROM table1

[code]...

View 2 Replies View Related

Using PDO To Select Multiple Rows?

May 4, 2011

I know about using fetchAll() to select a bunch of records, but each book I've read on the subject says this is not smart if the number of records is greater than 100 or so because it requires too much memory.

So how does one use PDO to select and display huge numbers of rows, if not with fetchAll()?

View 17 Replies View Related

Select Multiple Rows By ID In Sql?

Mar 4, 2010

I need to select multiple records

I use

SELECT *
FROM `table`
WHERE `ID` =5623
OR `ID` =5625
OR `ID` =5628
OR `ID` =5621

this query run 4 times in every second whit php

is there a better and faster way for this ?

View 5 Replies View Related

Multiple Items Out Of Select?

Aug 31, 2009

I have a select box set to multiple to allow a user to select a number of different items. How do I get all the items out of the html code and into php?

View 1 Replies View Related

ADVERTISEMENT