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.





Dynamic Pick List


I have been developing programs in perl and oracle and have recently switched to php. I need to create a form that has four of five seperate pick list on it. Each item in each of the pick list depend on the users previous entry. For instence if the user picks Ford then Taurus, Ranger, Focus,.etc show up in the next pick list then the user picks Ranger and 2 wheel drive, 4 wheel drive, etc show in the next pick list box on so on.

I know how to this if the screen is refresed after each user entry. What I would like to fugure out how to make the screen automatically update each pick list and not refreshing the whole screen.




View Complete Forum Thread with Replies

Related Forum Messages:
How To Use A Value From A Pick List?
I'd like to have a form that does the following:
User picks a site from a dropdown list from a MySQL db (that works -
code below, thanks to all those on the web who posted code for this).
Once the value is selected, a second query is run using the site as the
'where' clause and the results are displayed back to the user.

mysql, php, htlm noob. I think once I get this bit,
I'll be able to move forward with more interesting and complex code.

ps - if this message shows up 3 times, my apologies but I've been having
trouble posting.

<html>
<body>
<?php

// connect to db
$db = mysql_connect("localhost");
mysql_select_db("test",$db);

// build query
$sitequery = "SELECT site from sitedata order by site";

// generate result set
$siteresult = mysql_query($sitequery);

// use results
echo "Select a site from the list below: <br><br><select name='site'>";
while($siterow = mysql_fetch_array($siteresult))
echo "<option
value='".$siterow["site"]."'>".$siterow["site"]."</option>";
echo "</select></td>";
?>

</body>
</html>

View Replies !
Pick And Choose List
You have two list boxes on a page. On the left are all the choices, the right box is empty. In the middle you have "arrow buttons". A single one pointing right says "move the selected choice into the right box".

A single pointing left does the opposite. A double pointing right says "move all choices from left to right". A double pointing left does the opposite.

I am not sure if I can do this with PHP. Maybe Javascript? Or is it just impossible to do with web pages?

View Replies !
Allows Someone To Change The Given Attribute Via A Pick-list
I have a form that lists query results (members, attributes) side by side, and allows someone to change the given attribute via a pick-list. I'd like to know how all of the member attributes (one for each member listed in the query results) can be updated at once. I have no problem implementing this when just one record is being updated, but as soon as there is more than one record I get into trouble. Here's a little diagram of what I'm trying to do:

------------------------------------------
Name | Attribute
------------------------------------------
Member1 | Pick List
Member2 | Pick List
Member3 | Pick List
" etc " | " etc "
------------------------------------------

| Update |

View Replies !
Identifying User's Pick From Selection List
I have an application that uses PHP to access a MySQL table and
extract rows which match the user's search entry. Data from the
matching rows are loaded into an HTML selection list, and the user can
scan the list and highlight a selected item.

My question: In PHP, what is the syntax for identifying which row is
highlighted?

My goal is to pass the unique row ID of the selected item to a
subsequent form where all the fields will be displayed for the user to
edit.

I already have the code that loads the selection list and the code
that displays the fields. I just need to know how to determine the
highlighted item.

I have two PHP books, and both discuss loading the selection list, but
there is no mention of what to do next.

View Replies !
Pick From A Drop Down List That Automatically Gives Options In A Second Dropdown Box
does anyone know how to create a form that allows the user to firstly pick from a drop down list that automatically gives options in a second dropdown box. eg.

'category1'
is selected from dropdown box 1,
this then populates dropdown box 2 with the options
'category1.a' or 'category1.b'

or if
'category2'
is selected from dropdown box 1
then dropdown box 2 gives the options of
'category2.a' or 'category1.b'

i f any one knows how I should code this please help, if not point me in the direction of a tutorial that can.

View Replies !
Dynamic List Box
ok, im trying to make a select box (list box) so that its size is dynamic (depending on the amount or records of a given field (medivas), so I can make multiple selections from it. Code:

View Replies !
A Dynamic Drop Down List
I need to create a dynamic drop down list. By this i mean that the webpage html form = select style will recieve all the values as based on a query to a mysql database. I have no problems quering the data base with PHP, But i need to make some kind of for loop that will add a new value to the selct form for each result from the database. my thought process go like this.

1. call data base to guery. (no problem)

2. make variable variables that will be created according to the number of results (these variables must be created according to results of query, not a problem i think)

3. make a form like this

<form action = ***** method = post>
<select name = ******>
<option value = "This is a query result"> This is a query result> //This is the part i need to using a for loop and variable variables
</select></form>

so my problem is part 3, cause is this all done in PHP, or if i had all these variables, can i do this in HTML? Can i make a for loop in PHP that would break into HTML during these parts?

View Replies !
Dynamic Mailing List?
I have a schedule of people that need reminders sent to them weekly.  I have figured out how to set a Crontab to send the reminder automatically ... but the people are not the same every week.  I know that I could build multiple scripts and hard code the email addresses, setting a cron job for each - but is there any way to build ONE script that will read a text file based on the date and pull the names/email addresses off of that? 

View Replies !
Dynamic List Order
I was trying to get the list box to display the id numbers in ascending order however the code below does not work, just wondering how to fix it?

<?php
$g = "SELECT * FROM em ORDER BY iD ASC";
$q = mysql_query($g, $link_id) or die(mysql_error());

if (mysql_num_rows($q) > 0)
{
?>
<select name="d">
<?php
while($r = mysql_fetch_assoc($q))
{
?>
  <option value="<?php echo $r['Id']; ?>"><?php echo $r['Id']; ?></option>
<?php
}
}
?>

View Replies !
Generating A Dynamic List
I am tying to write a statement that will compare the values of 2 columns, and display the result in a temp table.

ex. Table A has the following columns: "Minimum" and "Maximum." The temp table will hold the reult of the difference between the 2 columns of table A.

Scope: I am trying to crate a drop down with the resulting data as it is incremented. If Min = 2 and Max = 7, the TEMP tab;e should get the results of 2,3,4,5,6,7. I want to have this result displayed in a drop-down list.

View Replies !
Dynamic Drop Down Box List - Php
I have two dropdown boxes. Two boxes have values from two different tables. They dont have any common field to relate with. I would like to display the values based on selecting the first combo box value. If i select first combo box value, then automaticlly the second drop down box value should be changed.

Code: ....

View Replies !
Sub Headings In A Dynamic List
I wonder if someone can help me with a problem I am having whilst displaying some external links that are being taken from a MySql database. The code below may not be the best writen but it does work.

I have a database of categories (See SQL below) that are highlighted in blue with yellow text. The contents (See SQL below) of each category are listed below each blue header using alternate green and yellow rows using a type number for each category. Code:

View Replies !
Dynamic Select List
I am wanting a dynamic select list which is populated from my DB. My query is:

  $query = "SELECT pk, type FROM un_styles";

I want to display the type in the select list, then use the selected type. So what i am basically asking is could someone show me the code to do this please.

View Replies !
Dynamic List Content
i'm making a hierarchical Order list for this i've created database where
parameter_cd,parameter_desc,upper_parameter_cd my page is like this Code:

View Replies !
Dynamic Form List
I'm trying to get a dropdown menu where the options are made up from entries in my database. Bellow is what I've tried but it only puts the first item in the list and the rest appear as normal text next to the dropdown box. Code:

View Replies !
Dynamic Drop Down List
I have poured over these and other forums, but can't find out what I'm doing wrong. I've found a few threads that deal with what I'm trying to do, but they didn't fix the problem.

What I'm trying to do is populate a drop down list based on info in my mysql database table. I have a game number id (game_ID) I want to use as the 'value', and the game name (game_name_long) that I want to use as the actual entry in the list box.

Here is the code I am using that takes the data from the db and populates the drop down list box: Code:

View Replies !
Dynamic List Items
I’m trying to build a multi-level unordered list from a database query. I can't figure out a good way to do this. How can I create this: Code:

View Replies !
Dynamic List Population
Code:

<form action="">
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>

View Replies !
Dynamic List From Sql Table
I would like to put a dymanic select list on a form with the choices coming from a row of a table, table has the structure

id colour1 colour2 colour3

and I would like to give the dropdown the colour associated with the entry for each of colour 1-3 so if a line has

id=sss colour1=red colour2=black colour3=NULL

I would like the dynamic dropdown to have 2 choices, red or black but if the next row had

colour1=red colour2=black colour3=green

it picks up those values instead. The info for each id will be different, I have a table being built populated from the same table at the moment but built from different columns so I have a suitable record set already.

View Replies !
Dynamic List Items Repeating Themselves
I'm working on this online magazine, and each page (well, other than the front page) has a menu included on the right-hand side consisting of articles divided into three sections: articles, columns, reviews. For some reason, whenever I click on one of these article links, that link takes the place of the first link in the section. You can see what I mean here: PHP for the included right_menu.php PHP Code:

View Replies !
Dynamic Checkbox List - DB Update
I have a set of questions which are being dynamically output:

for($i=0; $i<count($question_array); $i++)
{echo $question_array[$i][question] .

"<input type='checkbox' name='question_" . $question_array[$i][id] . "' value='Y'' . "><br>";}

I then want to update each question in the DB. I want to loop through each question id and carry out the relevant action (either enable or disable). What is the best way to do this?? As I am dynamically generating the variable name (e.g. question_50) what is the best way to loop through these updating the relevant id?

View Replies !
Dynamic Drop-down List In Array
Q. How do I create a dynamically-generated drop-down list for use in
an array.

I'm using PHP with a MySQL database (through phpMyAdmin)

My database table is called com_courses, and I want to pull the
distinct 'title' fields and have them appear as a drop down menu for
the user to select in a form.

Here is my array, with (at the moment) manually-entered 'titles'
(which I now need to be dynamically generated from my database field:
'com_courses.title'

array (
"coursetitle",
"Course Title:",
$EXTRA_SELECTLIST,

array ("Report Writing", "Recruitment & Selection", "Presentation
Skills", "Essential Telephone Skills", "Time Managememt", "Customer
Care", "Other"),
0
),

I am not an experienced programmer, but can play around with php to
customize programs. I've read up on arrays (I bought a "Programming
with PHP and MySQL" book, but it just stops short of this problem). I
can't figure this one out.

View Replies !
The Dynamic Zone Of List PHP. Please It 's Very Urgent!
I want to create in a form in php two zone of list (A and B).
the options of the zone lists B are dependent on the option chosen in
zone A.

View Replies !
Dynamic Form Option List
I want to create a dynamic drop down option list in a form, but I just can't wrap my head around this.

Both of the below scripts work as intended, but how do I make the mySql query results work with my existing script?  Yes, I know I must replace the "$options = array" part in the top piece of code, but I need a little more guidance than that. Code:

View Replies !
Creating A Sort Of Dynamic List.
I'm wondering how I should go about creating a sort of dynamic list. I have a folder, let's just call it folder, which is filled with files called... file01.jpg file02.jpg and so on, there is also a folder in folder called folder1. These are all contained in localhost/site/.

What I am wanting to do on a php page is list all the "files" inside folder, but not show folder1 in that list, and also for the files to be listed correctly, not like 1, 10, 11, ..., 2, 21, etc.

Plus above some files there will be headings. (These are all links as well to a php page files.php?#) And finally I would like to know how to, instead of displaying the filename, which would usually happen, but instead just cutting off the word "file" and the ".jpg" after the number.

View Replies !
Searching Dynamic Driven List
I have a members database will all their personal details in. I have a page running a SQL query to display a complete list of all these people. This is what my query looks like:

$sql_prop = "SELECT * FROM $db.members WHERE area = '".$_REQUEST['area']. "' ORDER BY name ASC;
$result_prop = mysql_query($sql_prop) or die(error_report("Mysql Error", mysql_error()."

$sql_prop", $_SERVER['REMOTE_ADDR']));

"Error Report" is just one of my functions. I have two forms fields on this page, "Name" and "Address". I want to be able to search the listing that this SQL query has returned for those fields, ie. the user enters "John" in the form field and it returns all entries within the query matching "John". The reason I'm using this:

area = '".$_REQUEST['area']. "'
in the WHERE clause, is just to ensure that the person viewing this list can only see members that are in his area. On the previous page there is a piece of code that gets the session "area" and brings it across to this page. I'm keen on keeping that code in. It works for me at the moment.

Any ideas? How can I search this already filtered list?

View Replies !
Dynamic Form - How To Set Values Of A List
I have a form with a list/menu in it that is populated with records from a database. The items in list#2 are based upon what is selected in list#1.

I have been able to use a combination of php and javascript to get it to work, but the javascript reloads the page to get list #2 to refresh - and that clears out any other fields that have been filled in. Instead of javascript being called for the 'onchange' event for list #1, I'd rather it call php when list#1 is changed and so reset the values in list#2.

OPTIONS:
1. I thought I could have a php function that is called (i.e.   onchange="<?php reload();?>" but I can't figure out how to set the values of the list from within the php function. How to reference form objects with php?

View Replies !
How To Create A Dynamic Dropdown List
how to create a Dynamic drop down list using Mysql.

View Replies !
Dynamic Dropdown List Using Access
I am creating a dropdown list that is populated from an Access DB: Code:

View Replies !
Dynamic List Has Multiple Entries
On an input form there is a dynamic drop down list to select from a dozen different categories. The form inserts correctly into the database.

The problem is that every time a category is selected the drop down menu list it an additional time. For example if the list has: apples, pears, oranges. If pears is selected the drop down list will display: apples, pears, pears, oranges. Code:

View Replies !
Dynamic Search/list Thingy
I would imagine something like this: PHP Code:

class request {
    public function getList($tbl, $cols = array('id'), $access_type = ACL::READ, $options = null) {
        // do option parsing, fetch data, return array
    }
}

( $options = single array which holds 'order', 'ordering', 'min', 'max', 'limit', 'offset', 'search_text' & 'search_col' )

View Replies !
Dynamic List Populated By MySQL Table
I am building my first php page and I've ran into problems trying to create a dynamic drop down list for an INSERT page. My page is based on this example from mysql.com.

I want to populate the list from a table in MySQL, but when I test the page the list only contains the first record. If anyone can help me out, or recommend an easy way to create dynamic menus/lists, I will be very grateful.

This code appears above the FORM ACTION:

$NearMajorCity = mysql_query("SELECT NearMajorCity_ID, NearMajorCity FROM NearMajorCity");

This code is within the FORM:

<SELECT NAME="NearMajorCity" SIZE=1>
<OPTION SELECTED VALUE="">Select One
<OPTION VALUE="">---------
<?php
while ($NearMajorCity = mysql_fetch_array($NearMajorCity)) {
$NearMajorCity_ID = $NearMajorCity["NearMajorCity_ID"];
$NearMajorCity = $NearMajorCity["NearMajorCity"];
echo("<OPTION VALUE='$NearMajorCity_ID'>$NearMajorCity
");
}
?>
</SELECT>

I want to be able to view the names of the Major Cities in the list, but I want the NearMajorCity_ID inserted into the table.

View Replies !
Member Area With Dynamic File List
I have an Apache 1.3.31 with PHP 4.4.1 available and want to create
some kind of "member area" with a per-user or per-group listing of
files that can be downloaded.

How would I do this?

At present I just protect the individual files using .htaccess
and .htpasswd files and give out direct URLs to the files together with
username/password. What I'd like is some login functionality where
people can log in using their username/password and then find a list of
files they can download together with additional information
individually tailored for that user.

View Replies !
Dynamic Drop-down List With Array - Question
Can anyone out there give me a pointer regarding creating a
dynamically-generated drop-down list connected to an array?

And is that question as clear as chocolate spread?

Here's what I've got. I'm using PHP and MySQL database. I'm customizing
some calendar software, and I want the user to fill in a form by
selecting a title from a drop-down list, generated by my MySQL
database. However, the program I'm customizing uses arrays, which is
where I'm stumped.

What do I need to add to this code to make the array of titles(eg
"report writing" etc) come from my database, rather than the
manually-entered values that you can see here.

The field I want to pull from is called com_courses.title

array (
"coursetitle",
"Course Title:",
$EXTRA_SELECTLIST,

array ("Report Writing", "Recruitment & Selection", "Presentation
Skills", "Essential Telephone Skills", "Time Managememt", "Customer
Care", "Other"),
0
),

I hope it's not cheeky to ask this,
BTW I bought a book on Programming with PHP and MySQL, but it doesn't
answer this question,

View Replies !
Using Multiple Values From Dynamic Select List
I have a selection list which is dynamically populated from a SQL query. When the user makes their selection, the result is passed to the next page. Code:

View Replies !
Mysql Ajax Dynamic List To Fill More Than 1 Textbox With A Dif.value For Each?
Ok, I have a database: ie...

Id | cab | price | w1

1 | wall | $300 | $19

on my form I have three textboxes: input1 is cab with autocomplete, input2 is price, & input3 is w1

The way I have it now works great, I type a few letters in input1, it pulls up a list, once cab is selected it populates input1 with cab and input2 with price.

I want to know once cab is selected, if it can populate input2 with price & input3 with w1 as well? Code:

View Replies !
Print A Dynamic List Of Files To Seperate Divs
I have a database table of files which fall into different categories. Each category has a numerical value.

I want to seperate the files into the correct <div> tags based on their category so I can then show and hide the <div> depending on which category is selected in a dropdown. It sounds easy enough but I can't seem to think right now and Im stuck.

So I would a have a string for each category. To this string I add the file information for each file in that category...and then print the strings..

View Replies !
Pick Up Page Name In PHP?
Is there a way, within a PHP script, to pick up the name of the web page that the script is being run on?

View Replies !
PHP To Pick A Table
In my attempt to be more organized I setup my database like this: DB:

-Table1
-Table2
-Table3
-Table4

and each table has 4 forms for information.

View Replies !
How To Pick The Closest Number
I've been wondering about this for a few days.

I have an array containing 4 numbers:

$listofnumbers = array(0,15,30,45);

Then there's a variable that could contain any number between 0 and 59.

$actualtime = date('i');

Using the above I want to find out which of the numbers in the array is numerically closest to the value of $actualtime. So

if $actualtime = 34 then I want to return the number 30
if $actualtime = 11 then I want to return the number 15 etc.

I'm sure there's a simple solution but can't figure it out.

View Replies !
Gmail Does Not Pick Up Sender Id
I had a shared hosting account with Godaddy earlier. I have script in my code which sends automatic emails to users when they sign up on the website.

All these emails were going in a proper format earlier. When i changed to Virtual Dedicated Server on Godaddy, emails which are automatically being shot to yahoo, hotmail or any other accounts are going properly. Code:

View Replies !
Pick Records Between Dates
I have this table

   id_hotel    |    ratesin      |  ratesout      |    rate
       1         | 2007-06-07   | 2007-07-15   |   100.00
       1         | 2007-09-07   | 2007-12-10   |   150.00
       2         | 2007-05-07   | 2007-08-10   |   150.00
       3         | 2007-04-07   | 2007-09-10   |   120.00

What I want to do is to make a selection and show only records between desired dates, example:

If I post via form: id_hotel = 1 ratesin=2007-07-07 and ratesout=2007-07-10, the result will show only the records in those dates range in this case the result will be:

   id_hotel    |    ratesin      |  ratesout      |    rate
       1         | 2007-06-07   | 2007-07-15   |   100.00

Maybe is easier than I think, how to achieve this.

View Replies !
Need A 'pick A Date' Script
where I can find a good, quick, clean script to provide a calendar from which the user can pick a date to populate a field? Ideally Im looking for a small pop-down as aprt of a larger page wide data form.

View Replies !
Checkbox Problem, He Always Pick The Variable Of The Last One
I have currently 2 awards in the database, with this script i pick them out of the database and define if they are selected and if the user unselect it then pass a variable to the database. Now it works almost good except that the script always looks to the 2nd award(last one), if the 2nd one is unselected then it updates award 1 and award 2 as unselected, when i unselect the 1st award and select the 2nd award then he updates the database with both selected(1st one and 2nd one), so the problem is that he always listening to the 2nd(last) variable/award. Does someone have a solution for this problem because i cant figure it out, greatly appreciated. PHP Code:

View Replies !
How Can I Pick All Checked Value In Action Page?
I have a dynamic category list, I have printed those list with check box in the form. I have to check those boxes and submit. How can I pick all checked value in action page? Right now only one value passing from several check boxes while several check boxes checked. Code:

View Replies !
Pick Apart Post Variable Names
i am dynamically creating a list of checkboxes for each job title in a db.

the checkbox array names are something like 'job2quest[]' & the 'job5quest[]'...

since i dont necessarily kno which jobs will appear, i dont want to hardcode the variables when the form is submitted.

is there a way to pick apart post variable names, so the script can find the checkbox arrays?

View Replies !
Pick Number By Random Selection...
Ok I have a column with a bunch of id's in it... is there a way to gather all the id's that are there.. and then show 5 of them by somekind of random selection on each page load?

View Replies !
Search :: Read Files And Just Pick Out Certain Words
I wanted to know if there is a way with PHP to read files and just pick out certain words. For example, I have an essay paper and I want to see if with php I can find out how many times I said the word "for".

View Replies !
List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that:

- reads in all the files in a particular directory
- displays the file names in a html list and makes a link of them:
<ul>
<li><a href="filelocation1">filename 1</li>
<li><a href="filelocation2">filename 1</li>
<li><a href="filelocation3">filename 1</li>
</ul>

etc.?

So basically it creates a list of links with the contents in that directory,
so you can download them from there.

View Replies !
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not.

What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings.

SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = &#391;') ORDER BY msgno DESC LIMIT 100

What I'm getting, though is a list that looks like this:

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1

I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary.

If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1.

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 2214 msgno: 0412141622 msglist: 1
mbxno: 2189 msgno: 0412141408 msglist: 1
mbxno: 0000 msgno: 0412141213 msglist: 1
mbxno: 0003 msgno: 0412141213 msglist: 1
mbxno: 2265 msgno: 0412132029 msglist: 1
mbxno: 0000 msgno: 0412131950 msglist: 1

How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?

View Replies !
Produce A List Of Tables Currently Within My Database And List Them In A Drop Down Box.
I need to produce a list of tables currently within my database and list them in a drop down box.

View Replies !
Populating A List Box Or A Dropdown List Using Php And Odbc
I need to populate a list box and/or a dropdown list on a form. I have all
the bits and pieces together, all bar the code which takes the result of a
query and creates a list box.

View Replies !

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