Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Combo Box?


how to make combo box link with my database? I want my data appear when drag down the combo box Can someone help me with the code i should use???




View Complete Forum Thread with Replies

Related Forum Messages:
Combo Box Value
On my site, if you click on a link i want you to be taken to a contact form that contains a combo box, but what I want to do is predefine what value of a possible five selections is set... What is the best way of doing this?

View Replies !
If And While Combo
I want to combine an IF statement with a WHILE condition.. They work fine seperate but i can't seem to combine them the way i want. Look @ my code so far: Code:

View Replies !
Combo Box
I am allowing users insert data into a database using a form. I want one of the fields "department" to display all existing departments in the database in a combo box for users to choose from and also have a field in the combo box for them to add a new department. Is there a way for me to do this in using php? I am using php to access the database.

View Replies !
Combo
I have a combo box :

<select name="stock" id="stock">
<option value="In Stock">In Stock</option>
<option value="Not in Stock">Not in Stock</option>
<option value="Discontinued">Discontinued</option>
</select>

I am connecting to the database and i want to display the results in a form and change the value of the combo box to the one value in the database for that record. How would i set the combo box to the correct value using php.

View Replies !
Combo Box With ALL
In a combo box, I have the user select a company name and that name is then sent to the query. What I am trying to do is if no selection is made, the query would still run as if all the selections were made, returning all the companies which fall into that category. Do you know how to do this? I created an <option>ALL</option>, but cant figure out what its value should be?

View Replies !
Combo Box And Sql
can any1 give an example of a query being called from a database in sql and the result being stored in a combo box in php?

The code for a normal combo box sending the value as item is show below but i want the options to be from specifically in the databse.

<select name="item">
<option>Paint</option>
<option>Brushes</option>
<option>Erasers</option>
<?php
$_POST['item'];
?>

View Replies !
Combo Box Values
I have values in a combo box where datas are coming
loaded dynamically. When an user selects a particular value and press search, even after refreshing the page, I want to keep the value same as the user selects. For example suppose if I selects
value PHP from combo box, after submitting the combo box should
value highlighted must be PHP. IS there any way I can do this?

View Replies !
PHP/MySQL Combo
How come sometimes I get the following error:

Fatal error: out of dynamic memory in yy_create_buffer() in Unknown on line 0

My code works most of the time, its a combination of PHP and mySQL, i have no function named "yy_create_buffer". And the worst problem with this error message, is that when that error comes up, its the ONLY thing that comes up.

Other error messages at least they show up inside my page and they say what I specify the error messages to say. This type of error message would look totally unprofessional on the site I'm developing and I'm curious is there anyway to prevent this or somehow pinpoint the cause.

I'm starting to lose faith in PHP/mySQL . I'm starting to doubt whether the PHP environment is effective for a search engine which searches what will be a relatively large database.

View Replies !
Selected Combo Box
i have the following code and i am having problems with setting the combox to select the value that is stored in the database. i am hoping that the combo box selects the value and the value from the database is stored in $title PHP Code:

<?php
function displayedit($id,$title,$fn,$ln,$instit,$depart,$email,$url,$room,$phone) {  
echo '
  <form name="editform" method="post" action="editform.php">

  <p class="body"><b>Title:</b>'

    $t ="Dr","Professor","Mr", "Ms"
    echo "<select name='selectTitle'>";
    foreach ($t as $value) {
     echo "<option value="$tvalue"";

View Replies !
Populating A Combo Box
Using php how can i give a combobox a default value when the page is loaded?

View Replies !
Make Combo Box
Suppose in the client side there is a table in which name of car manufacturer is given then if we click on it the different models of cars should come on he other list. give stepwise info.

View Replies !
$_POST & COMBO BOX
I just need the option chosen in another php file. i have the following peice of code in my index.php

<select id="papertype" name="papertype">
<option value= "0">Gloss</option>
<option value= "1">Gloss</option>
</select>

i need the chosen option in the details.php file (this doesn't work but here is what im using to try and call)

$desc= $_POST ['papertype'];

View Replies !
Combo Box To Submit
how do I use the combobox to submit the page to itself? I want to use the combobox to submit then when it opens itself again, the textfields below would be filled with data form the DB.

View Replies !
Need To Add A New Combo Box For States
Please want to add a new combo select box for states, once the country is selected, the states need to get populated in the states combo box.

Right now the current functionality is doing the following: when country is selected it is populating all the city names: I am attaching the files registration.php and registration_form.tpl.

View Replies !
Dynamic Combo Box
Iam working with a php, mysql program, In this program I have let's say 3 combo box (select tags) one for student_id , one for first name and the other for last name,

I already got data from mysql using( select * from student) and put them in these combos, but I need onchange of each one to execute another select statement (for example if we change first name select * from student where firstname=....), so I need to clear the other combos and refill them again according to the new query. so, I'll obtain all the students whose first name=...

here we need to call a function that makes combo clear using javascript (form1.fn.options.length=0) and also execute a new query(select * from student where fn=..) and refill combos again(new option(....))
my questions are:

1. do I need to call php function or javascript function onchange of select tag and if php how can i do that? 2.how can we take form variables (value of select) and put them in sql statement?

View Replies !
Combo Based
I need a solution to load data from db in combo based on the option selected in the previous combo for eg. have the list of countries(from db). should load the states(from db) based on the value we select in the country combo.

View Replies !
Combo Box Updating
I'm making a database input page for online gaming, and I'm having a little trouble. It's for a horse racing game, and I will be the only one doing the input. but I want to do the following: display only "player name" combo boxes. As the players are selected, I want to display the "horse name" and "driver name" combo boxes.

View Replies !
Database Value Select In Combo Box!
This function is intended to display the current database field value as selected.. along with other values as general options.

I can't figure out how to get it work. Help is appreciated!!

function retrieve_category()
{
$cat = mysql_query("SELECT category_id FROM category");
while ($current_row = mysql_fetch_row($cat))
{
$row = $current_row[0];
if ($row == $id)
{
printf("<option selected>%s</option>
",$current_row[0]);
}
else
{
printf("<option>%s</option>
",$current_row[0]);
}
}
}

View Replies !
Combo Boxes Question
I am wondering how I can make the whole array appear in the code that is below with the database entry to be selected. At the moment it just displays the database entry.

View Replies !
Populating Two Combo Boxes
I have one combo box (Category) which is populated by a MySQL table using php. I am trying to use the onchange javascript to submit the value selected so that I can populate the other combo box (sub-category) based on what was previously choosen. So can anybody give me a clue on how to submit the first boxes value so that the second can see what was selected (javascript function).

View Replies !
Combo Box / Text Box Php Mysql
this is the the code, now here is the final result.... I get one combo box
<?php require_once('..library_databaseConnectionsonli nequote.php'); ?>
<?
function select_cases_price ()
{
$qy = "SELECT SellingPrice, Description FROM cases";
$rs = mysql_query ($qy) or die (mysql_error ());
while (mysql_fetch_array ($rs))
{ $select .= "<option value='{$r[0]}'>{$r[0]}</option>";
$prices[] = $r{1};
}
return array ($select, $prices);
}
?>

On your web page, call the function.

<? list ($select, $prices) = select_cases_price (); ?> And a bit of JS:
<script>
function showPrice() {
array prices (<? echo $prices ?>);
var i = document.form.item.selectedIndex; document.form.SellingPrice =
prices[i]; </script>

<select name="Description" onUpdate="showPrice()"> <? echo $select; ?>
</select> <input type="text" name="SellingPrice" value="">

View Replies !
Combo Box Value On Page Reload
I am new to php and mySQL so this is probably something very basic that I'm
missing. Basically, on the page I have 2 combo boxes but 1 of them is not
getting the value passed when the page is reloaded so the database can be
updated. I am echoing the field names passed and the field "theDriver" is
there but it's empty. I've include the code parts where I believe the
problem should be but I'm stumped and I've been trying to solve this for 2
days without success. Would someone mind examing the following code and
tell me what I've done wrong?

Following code constructs the combo box on the page from a MySQL table:
<?PHP
$table = "tblEmployees";
$Link = mysql_connect ($host, $user, $password);

$Query = "select concat(empID,' ',empFirstName,'
',empLastName)
as full_name from $table WHERE empTitle =
'Driver'";
$results = mysql_db_query($database, $Query, $Link);
?>

&nbsp;&nbsp;&nbsp;&nbsp;<b>Driver:</b>
<select name = "theDriver" size="1">
<Option Value=" ">Select One:</option>

<?PHP
for($u=0;$u<mysql_num_rows($results); $u++)
{
$driver=mysql_result($results,$u,'full_name');
?>
<option value="<?PHP echo($ID); ?>"><?
echo($driver); ?></option>
<?PHP
}
?> //end php

</select>

When Page is reloaded the following code is run but the combo box titled
"theDriver" is empty

foreach($_POST as $field => $value)
{
echo $field; //field names from form
echo "; ";
if ($field == "theDriver")
{
echo " - here's the driver for ya: ";
$$field = strip_tags(trim($value));
echo $$field;
$pos = strpos($driver, ";");
echo "<br> the ; is in pos $pos <br>";.......

View Replies !
Dynamic Combo Boxes
i have a problem with creating some dynamic combo boxes. i have a form and the user enters the number of printers required, on the recieving page i display that many combo boxes ready for their input...but the problem is its not generating the correct number of combo boxes for some reason. i think i'ts because i need to reset the cursor on the result set so it can whip through the printers again but am not sure. please see following code:

View Replies !
Php Checkbox And Textbox Combo
I have a form which asks:

How did you know about us?

--friend
--flyer, where_______
--web
--other, _______

I want to store in the db whether the user checked the box and on
certain questions, store the additional description, as indicated by
the _____

How do I go about in doing this? I need help getting the values to
perform an INSERT in the mysql table using php.

View Replies !
How To Validate A Html Combo Box
I have a combo box on my html page that i would like to validate through php processing.
the name of my combo box group is "location" how would i use an IF statement to validate the contents of this combo box?

View Replies !
Mysql Dynamic Combo Box
i want to have a combo box that is populated by certain filelds of a mysql table. how is this done using mysql, php. i saw some other posts about using, javascript. must i?

the table that it is calling from isn't updated very often. also, one other note. i want 4 columns of the table represented in the 1 drop down box, so that users have a more specific description of the row they are selecting.

View Replies !
Creating Simple Combo Box
Very new to PHP and would like to create a combo box in which:

1. I have set an intial value (e.g. "mollusca") and
2. the user has the capability of adding additional values to the list.

View Replies !
Combo Drop Box Validation
im just starting to learn php and its taking me forever to figure out how to validate my single select courty drop box Code:

View Replies !
Combo Box Required Field
I have a combo box with 6 options:

Choose an option
1
2
3
4
5

and I want the user to rate it from 1 to 5, but when user selects option "Choose an option" I want an error message to be displayed saying that you have to select from 1 to 5. How do I force the user to select these options 1 to 5?

View Replies !
Populating Combo Box Dynamically
when I click on a Country name in the first combo box the name should be checked on the database and the name of the respective states. should be populated in the next combo box dynamically. please give us the basic code and the way to go ahead to develop the code. We are new to PHP ,we have read the basics but how to develop now?

View Replies !
Generating Combo Lists
Lets say I have an array:
$fruitarr = array("apple", "banana", "orange", "lemon", "lime", "strawberry");

And I need to generate a list of smoothies over a period of 8 weeks. Each week only two of the fruits can be used together at a time. So for example, the choices for week 1 would be: Code:

View Replies !
Combo Box Call Out Values
I have a list of areas in a DB and want to call these out to a Combo Box:

id | area
----------------
1 |Slough
2 |Burnham

Now I thought the below code would output these, but it does not

PHP Code:

View Replies !
Populate Combo Box Based On The Value Of Another One!
I need to query two tables using two combo boxes. The tables are of this type : author/publications , brand/products ..etc..

Whenever I chose a value in the first ComboBox , the second one should be populated based on the value chosen in the first one.

The first combo box is populated, so I can tell that nothing is wrong for the first combo box code. however, when i try to change it's value nothing happens , "the scond one is not populated". 

I don't know what is the problem.. Maybe it is a mistake to pass javascript variable to php using IEwindow.location.href ?!. If it is a mistake ,then how can i pass javascript variable to php variable?? Code:

View Replies !
How To Pass A Combo Box Value To Next Page?
i've a combo box filled with values. i need to pass the value of the selected value to the next page.

View Replies !
Problem In Combo Loading....
i have TWO combo Combo A and Combo B, Combo A fetch data from database means dynamic values....

now i want that if user select Combo A and select prticular row or index and press ADD button than the selected value should add to Combo B...

if user selecte ALL vaulues from Combo A and press ADD button than ALL Combo A values should copy to Combo B...., i am getting javascript error "object is null" here is my code:

View Replies !
Select Combo Hidden
I want to make "hidden" this select combo but without lost the functions of this.

<select name="mask">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
<option value="4"></option>
</select>

NOTE: if I use: style="visibility:hidden" the functions broken.

View Replies !
Minipulating Combo Box Values
I am working on a form and would like to minipulate the selected list item in a combo box. I am taking values from a record in MySQL and filling in form fields. Can I access the combo box like in JavaScript where you can do it like the following:

document.myform.combo1.value="myvalue"

or do I have to code the whole combobox in php like the following (I would really like to avoid it): *HTML Tags May Be A Little Off - Example Only. Code:

View Replies !
IP Address/Image Combo
I am looking for a way to do this, and it looks like it is really simple. Basically, I want a PHP script to store unique IP addresses into a database from visitors that come to my site, compare them against predefined addresses, then send predefined images for those IP's back to the webpage. Basically, so people can see who is currently on the site.

View Replies !
Insert Values Within Combo Box
I have an combo box and I want to make it insert the value we choose to the database.

View Replies !
JAVASCRIPT& COMBO BOXES & AUSTRALIA
i am looking for a already made combo box script.... The combo box needs to be valid for the states in australia... State to suburb to postocde to street would be the ultimate, however even state to suburb would be helpful...

or anything that will break the states and suburbs down in australia.. This would be a long and time comsuming task and would appreiciate it if someone knew of a script around that does exactly that.

View Replies !
Load Data From MySQL In Combo Box
I am trying to grab the data from a data table in MySQL and and add a column to the selectable values of a combo box. From there I will grab that value selected stored in a variable and run a query for more data.

View Replies !
Add/edit Combo Form--opinions Wanted
I would like to use the same form for adding new records and editing
existing records. New form values are contained in $_POST. Database values
are contained in an associated array. It seems to me that in order to use
the same form for both tasks, I need to assign the form field values to page
variables. The flow might look something like this:

if $_POST

$variable1 = $_POST['field1'];
$variable2 = $_POST['field2'];

else if $rows

$variable1 = $row['field1'];
$variable2 = $row['field2'];

View Replies !
PHP String Concatination With Html Select Combo Box
I have problem in PHP String concatination with html select combo
box.

There are 3 files

addressbook.sql :
concat1.php
concat2.php

In concat1.php , if we select User Name in combo box & give input as 3
in
text box.
It display following output
subhash kanade,3 sk@yahoo.com

But, it is not display in that way.
So, please see that code & tell me correction.

addressbook.sql

-- Table structure for table `addressbook`
--

CREATE TABLE `addressbook` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `addressbook`
--

INSERT INTO `addressbook` (`id`, `name`, `email`) VALUES (1, 'pramod
kumar', 'pk@hotmail.com'),
(2, 'vinod wagh', 'vinod@rediff.com'),
(3, 'subhash kanade', 'sk@yahoo.com'),
(4, 'ketan patil', 'kp@hotmail.com');

concat1.php

<?php

mysql_connect("localhost","root")or die("Database Failed");
mysql_select_db("pradeep")or die("Failed to Connect Database");

$arr=array("concat(concat(name,','),id)","email");

$str="select ".$arr[0].", ".$arr[1]." from addressbook";

$res=mysql_query($str) or die("resultset error");

echo "<table><tr><th>User</th><th>Email</th></tr>";
while($row=mysql_fetch_array($res)){
echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";
}

View Replies !
Combo/list Box Showing Values Selected
I have a combo box being populated dynamically through php using a mysql database, and everything works fine.

My question is: How would i make it keep the values selected, once the user hits the submit button? For example, let's say i have a combo box with the values 1 2 3 4 5 in it. The user selects &#393;' and hits the submit button (which posts to the same page). At that point, i'd like the combo box to still have &#393;' selected, instead of resetting itself.

View Replies !
Multi Select Combo Box - Retrieving Data
I have a combo/listbox with "multiple" enabled in an HTML form and pass this to a PHP script, I should be able to access each item as $array_name[0] etc?

Thats what my book says and what I've been able to track down on Google seems to agree, but the only element I seem to be able to retrieve is $entry_select[0] (from the form below) which contains the last value selected in the combo list. Attempts to select $entry_select[1] just result in nothing printed. Code:

View Replies !
Retrieve Data From Multiple Tables Via Combo
I am working on a small project to create a single web page which retrieves data from 3 tables.

The first table is retrieved by a combo box. It only contains the primary key of the table. I know how to get the data in the combo.

The second table contains other information, related to the primary key of table 1. I know how to retrieve all the data, but not how to retrieve only the data of the selected primary key. I think I should work with a WHERE clause in the SELECT statement, but I have no idea how to get to the selected value.

The third table should work in a similar way, so when I have an answer for the second table, I can also use it for the third table.

View Replies !
Create Two Combo Boxes For Two Tables Of My Data.
I have created a form to retrieve data from mysql database I want to create two combo boxes for two tables of my data. When I ma using the one everything is ok but when I add the second they do not work as I do not know what exactly to change in javascript and php code. The code of the page is "linked-combo4.php": Code:

View Replies !
Read Dir And Sub-dir And Return It To Combo Box (selection Box, Dropdown Box)
Here I have a code that read trough a directory and return every image to a selection box.

I would need that code to read trough a directory and return all images with in that folder and is sub-folder, all his sub-folder. Code:

View Replies !
How To Create A Combo Box And Store The Selected Value In A Variable
does any 1 know how to create a combo box and store the selected value in a variable say $x? 

View Replies !
Double Combo In Javascript Search Form, Data From MySQL
I try to make a double combobox in php/javascript. I already have a working version of this that uses PHP+Templates, but I do not want to use Templates. Code:

View Replies !
Make Selected Option Stay Selected In A Combo After Submit
I have 3 comboboxes, one for the day, other for the month and another one for the year. Every time i select a value for the three of them and press the "Submit" button, they reset to the default option. Anyway this can be solved?

View Replies !
Multiple-combo - Multiple Mail Recipients
I am new to scripting but trying to create a page that lets users create an e-mail (mailto after having chosen from two drop-down menus (arrays).

I have managed to do so in HTML by using a Java script borrowed from Randall Wald (http://www.rwald.com).

However, I don't want the e-mail addresses to appear in the page to avoid spam. Is there a way to do so by using PHP?

P.S.: The first array contains (University A, University B) and the second array (Faculty, Staff, Students), i.e. 6 different e-mail addresses

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved