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.





Cascade Dropdown Or Conditional List


I would like to create a conditional cascade form.  based on the selection, it can display or not display an input form for the user to enter an string of text. then at the bottom of the page (or when a user submit) connect all the sections including the input field all together (it's like a story maker?)




View Complete Forum Thread with Replies

Related Forum Messages:
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 !
Conditional List Boxes
I am attempting to create a list box that is dynamically populated based on the selection of another list box.  I am in way over my head..only way to learn I guess.  The code below has a year listbox and then based on the year selection, the page should either show another listbox (show industry selection when year <> 2005) or it should render the main form (when year=2005). I cannot get the main form to appear. Code:

View Replies !
Dropdown List
I have a Dropdown list with Select with 1, 2, 3, 4, after select on of them it bust to refresh the page to what you select but it don't do it. PHP Code:

View Replies !
Dropdown List Box
I am able to populate data in a dropdown list box using php and mysql. However, I a wondering if i can add inside some icons such as close or More records,  where the drop down acts to the specified request, ie., closing the drop down or fetching  some more data from backend.

View Replies !
Populating Dropdown List
I am wanting to know how to populate the <SELECT> dropdown menu with all existing values from the DB and also have the value associated with that id selected. This is an updating area of my admin. Any ideas? Here's the code so far. At the moment it only retrieves the value assigned to that id. PHP Code:

View Replies !
Smarter Way Of Doing Dropdown List?
I've got a dropdown list that is acting as a filter on a table, so the user can select a value and the page is reloaded only showing the matching values from the database.

Now when the page reloads the dropdown was set to 'all' as it was first in the list, even if I'd selected a different value, this was confusing for users, so I added an initial <option> field which pulled the correct value from $_GET (code below) - however this is a little odd as it means the value appears twice!

Does anyone have a genius solution to this?  I've seen a <select selected="yes"> sort of thing around, but I don't know how I can tell the php to add this value dynamically? 

<select size='1' name='occupation'>
<option>".$_GET['occupation']."</option>
<option value='All'>All</option>
<option value='Student'>Students</a></option>
<option value='Professional'>Professional</option>
<option value='Hobbyist'>Hobbyists</option>
</select>

View Replies !
Mysql Dropdown List
Im trying to automatically fill a dropdown list with data from MYSQL table.

Sizes Table
--------

ProductId | size1 | size2 | size3 | size4 | size4 | size6 |

* the 'size' rows hold a numeric value for the quantity I have of each

I was hoping to only list the sizes that have a greater number than 0.
I have used an auto fill select code on another project but I'm just not sure how to fill in the blanks. Code:

View Replies !
List The The Entries Of The Dropdown Box
How can I list the the entries of the dropdown box (which are all populated) according to the time they are populated.

View Replies !
Check The Dropdown List
i have a drop down list in my php code. i need to check the drop down list is set or not. for that what is the code. i heard that there is no php code for that. javascript is needed. my code is here. PHP Code:

<?php
$database="sms";                    /* DB name       */
$host="localhost";
$user="root";                        /* Set DB Username */
$pass="";                            /* Set DB password*/
mysql_pconnect($host,$user,$pass);  /* DB connect....*/

mysql_connect ($host,$user,$pass);

mysql_select_db($database) or die( "Unable to select database"); /*DB Select*/

function orgresult()
.......

View Replies !
Add Variables To Dropdown List
I have a list of variables:

$variable[0]
$variable[1]
$variable[2]

The amount of variables changes so i've used $total = count($variable) to find the amount there are.

How would i tell php to create a dropdown menu with the amount of options=$total and then fill the options with $variable[0] etc.

I know i can use a loop to increase the value of say $i by one each time to that i can use $variable[$i] each time, i'm just stuck with adding the whole thing to a dropdown menu with the right number of option...

View Replies !
Autopopulate Dropdown List From Database
An events-registration page with a form containing a dropdown list for upcoming events, the events will be pulled from a table which is updated by...?

what i've gathered so far is that this can be done with PHP. I am a little unclear on the concept of how this is done. How does the updated information get input into the table?

1) can this be done (updating database) through a web interface by the client, or is it something i would have to do locally and then upload. If done by the client, can he delete/edit existing information--assuming he is not familiar with code.

2) what other things aside from html(good), sql(so-so), and php(newb) will i have to know?

i've seen a lot of good tutorials here and will have access to the necessary software. I just want to know if there is anything else i should know before i dive in head first without testing the PHP water, which i assume is frigid.

View Replies !
Dropdown List Of Files In Folder
I am preparing a form that includes a drop-down list consisting of the names of files in a certain folder on the server.

I only need to trap the file name (jpg), not the path and I'm not trying to upload the files or anything - simply allow the user to select one of a number of different image files (they're actually location maps).

View Replies !
Dropdown List - Trying To Get Default Populated From Db.
Nooby question but when I try and get this to work (it should identify which
rows in the database have GK, MID, DEF, FWD against them and then put
SELECTED into the option value to give a default of what the entry is
currently) it just adds SELECTED to all the results as if $row["Position"]
is returning true against all four conditions? What am I doing wrong? CODE:..

View Replies !
Microsoft Access Dropdown List
l am building a new site using PHP which has a lot of pages pulling from an Access Database. I would like to have a dropdown list that pulls exhibitions from the database and then when the user selects one it shows the rest of the details from DB just below the dropdown list, hope that makes sense. Code:

View Replies !
Trying To Create Dropdown Menu From List
I am trying to create a dynamic dropdown select menu from a directory containing other directories and files. This is to select a certain page from the list so I can edit it. I only want the files in the menu. Here's what I have so far but it doesn't populate the dropdown. Code:

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 !
Dropdown List Selected By Default?
Does any one know how to have an item in the dropdown list selected by default?

$city_field = HTML_QuickForm::createElement('autocomplete', 'city', 'City', $cities);

$cities is an array of city names and I would like, say 'Los Angeles' selected by default.

View Replies !
Dropdown List - Insert Into Mysql
I simply want to add a dropdown list where, when an option is selected, its value will be inserted into a dbase table. More specifically, asume there is a page where the user sees his order.

He will be able to select the order status (pending or delivered). So, for example, if his ordered is deleivered, by selecting "delivered" option, "delivered" will be inserted into the 'Status' column. Code:

View Replies !
Change List View To Dropdown Menu
Im working on a script that has to be change so a user can choose from a dropdown menu instead of a list that now is displayed.
Here is the part that is insert on the index page.

View Replies !
Auto Fill Dropdown List Error
Im using the code below to autofill a dropdown list from my MYSQL DB.
The only problem is it is leaving out the first entry (alphabetically) for each $vehicle_make ? Does anyone know why this may be hapenning? Code:

View Replies !
Stuck On Dropdown Menu List, Could Use Some Guidence
I have a form with some drop down list/menus. I do a check for ommissions and if found display a message to re-try. What I need is a way to show which options where chosen when the user submitted the form the first time.

If someone could show me how to do the first one, I'm sure it's the same process for the second one. Here's the code:

View Replies !
Auto Fill Date Dropdown List
How would I modify this code to display the years in the dropdown list like so:

current year
2006
2005
back 50 years

<select name="year" id="year">
<?PHP

for($i=date("Y");
$i<=date("Y")+2;
$i++)
if($year == $i)
echo "<option value='$i' selected>$i</option>";
else
echo "<option value='$i'>$i</option>";
?>
</select>

View Replies !
Creates A Dropdown List Of Information Belonging To That User.
I have a page that uses php to look up specific fields in a specific table of a specific database based on the username. Using this, it creates a dropdown list of information belonging to that user. The fields in question each have 13 pieces of data. Based on what they click in the dropdown box, I need that specific data to pass onto hidden fields on the page. Code:

View Replies !
Easy Comma-delimited List To Dropdown Box Converter
I was working on a simple converter when I realized that by not setting the id param of the option tag, it wasn't going to send the value of the dropdown box to my php script. I had this to start with: Code:

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 !
Dropdown List Which Selects A Post A Title (to Edit)
I want to have a dropdown list which selects a post a title (to edit), then when you click submit I want to use POST to submit the data for that post (post title, username, subject, content) so that the edit pages form fields will already be filled with the posts data.

View Replies !
How Do You Do A CASCADE Delete In MySQL?
I'd like to delete a record and all its children records at one time. How
do I do that?

Can you, in one SQL statement,

delete from table 1 where id = 3
delete from table 2 where id = 12
delete from table 3 where id = 12
......

View Replies !
Dynamic Dropdown And Hardcode Dropdown In Select Form
I have plenty of examples of dynamic dropdown choices but none of hardcoded dropdown choices. The ultimate goal is to have a job with various tasks and to track the status of those tasks for a given job. I've used one of the tutorials here to begin the process. Below is the code I have to add work on a given task. Perhaps I actually need to "Update" a job as opposed to "add".

But the problem of the moment is I can't seem to hardcode one set of my options. This is the code I have: PHP Code:

View Replies !
Conditional
I am having an issue here that no matter what happens, my else statement is always displayed with my if! Can someone help me, I can't seem to find where I messed up. PHP Code:

if ($_GET['cat'] == "wired") {
    $f_p = "iframe_wired.php";
    echo "<iframe src="$f_p" name="$f_n" scrolling="$f_s" frameborder="$f_b" align="$f_a" height="$f_h" width="$f_w">
    </iframe>";
} else {
    exit();
}

    if ($_GET['cat'] == "wireless") {
        $f_p = "iframe_wireless.php";
        echo "<iframe src="$f_p" name="$f_n" scrolling="$f_s" frameborder="$f_b" align="$f_a" height="$f_h" width="$f_w">
..........................

View Replies !
Conditional Loop
I have one table, "players" that has player info including start season (year). I then have a table for each season with player stats, i.e. games played etc called stats200X where X is the year obviously.

I have no problem with extracting data from the current year, but what I would like to do is get data from previous years too. I was thinking about doing something like:

(year) - (startyear), which for example could be 3.

I don't know where to begin, but I want to be able to loop though previous years so that, if tables exist of course, I could do

select * from stats{Y -1}
display
select * from stats{Y -2}
etc

Would I need to hard code this or is there a way of doing this though a conditional loop?


View Replies !
Conditional Login..
I have a form with a username & password field along with 3 radio buttons.

What I basically want to achieve is if radio button A is checked it will post the username & pass to a.php, If button B is checked it will post the username & pass to b.php and so on for button C.

View Replies !
Checkboxes,conditional
Basically I have what seems to be a very small problem but I am driving ny self mad trying to figure out what the problem is. Here is what I have: I have a form with two checkboxes:

<input type="checkbox" name="medicalcheck" >
<input type="checkbox" name="dentalcheck" >

the form is posting the a php file, decision.php, that simple checks to see if the boxes have been checked and performs an operation in either case. Here is the code:

View Replies !
Once Conditional Causes Error, The Other Doesn't...why?
There are 2 if statements at the beginning of this code snippet.  The one that is currently commented out works while the one that is not commented out yields this error

Parse error: syntax error, unexpected '{' in C:xampphtdocsench2index4.php on line 106

I am just not seeing why. Code:

View Replies !
Conditional Structures
I am wondering about conditional structures and the depth of nesting allowed, if at all. For example I know I can do this: Code:

View Replies !
Conditional Form
I want to condtionally display an HTML form. I havnt got a clue how it can be done, I suppose its the same way as putting html tables in php, but I cant get it to work. Here is the condtion:

<?php 
 if (!empty($pk))
  {    

And here is the form:

<form action="google.php" method="GET" name="deleteForm" >
<input type="hidden" name="pk" value="<? echo $pk;?>">
<input type="submit" value="Delete">
</form>

View Replies !
PHP Conditional Include
I just set up a perl script that outputs a single html file. Works great, but I need to be able to customize that one file for different sections of the site. Specifically I need different navigation and heading on the page.

I'm not a programmer, but this sounds like I want a conditional include to show what I want when I want, right? If so, can anyone give me any idea how to get started with something like this? I figured I'd try with PHP because it sounds easier than fooling with perl.

Also, doesn't a conditional statement generally work from a variable or something else in the page that changes? If so, what do I do when the page stays the same and doesn't include variables?

View Replies !
Include In Conditional
Why does this not work?

if (!$artnr) {
include "./smalltable.php";
}
else {
include "./bigtable.php";
}

Is this the best php group for this sort of question?

View Replies !
If/Else Conditional Statment
I just started php yesterday and found a site with a good tutorial but there's a problem, the "If/Else" statment doesn't seem to work, don't know if it's wrong in the tutorial or what. Code:

View Replies !
Conditional Redirection
I understand the header thing but wanna redirect to different pages based on values entered on the previous page.

View Replies !
OR Conditional Statement
I am trying to do this. But for some reason or does not work. How do you do an or statement with PHP?

if ($var == 8 or $var == 9) {
print "is eight or nine";
} else {
print "not eight or nine";
}

View Replies !
More Than 1 Conditional In A Function
This is a great function I use to echo timestamps as "how long ago" timeframe. This function rounds up the time to the smallest hour, so that 2:55 echos "2 hours ago". The only conditional in this function is Code:

if($difference != 1) $periods[$j].= "s";
and what it does is to add an "s" if the second, minute, hour... is not 1 (pluralization).

I need now to add another conditional so that for anytime greater than 5 hours and less than 24 hours it will echo just the word "Today". I tried many possibilities without much success. Code:

View Replies !
Conditional Against A Variable
what is wrong with this statement? The $ session is defined on the page. $session;

if($row_test['P_ID'] = $session){echo'show value'}
elseif($row_test['P_ID'] <> $session){echo'do not value'}

View Replies !
Conditional Submit
I'm creating a subscription form and i like to know how to create an interactive submit button. What i want is a submit button which only can be used when they agree with the terms of conditions by checking a checkbox.

View Replies !
Conditional Expression
I am trying to list products that are greater than $100 and less than $250. Yet the expression isn't working.

if ( $price >= "$100" ) && ( $price <= "$250" ) echo "$item<br> "; else echo " ";

Obviously if I set my query to

$query = "SELECT * FROM products WHERE price > '$100' AND price < '$250' ORDER BY id ASC";

it works.

View Replies !
Conditional Echoes
I need to place all this within the the echo, but get nothing but a blank page when doing so. (so this only shows when values are present.) Code:

View Replies !
Conditional Processing
imagine i have the following code PHP Code:

if($var == 12)
{
echo 'blah'
echo 'blah'
echo 'blah'
echo 'blah'
echo 'blah'
echo 'blah'
echo 'blah'
echo 'blah'
echo 'blah'
echo 'blah'
}
else
{
echo 'blah'
}

lets imagine that if $var is 12 the page takes 5 seconds to load. if $var isnt 12 will the page still take 5 seconds to load? I need to know if the unused code in conditionals are still processed, or maybe processed before the conditionals.

View Replies !
Conditional Formating
im working with a calendar script called phpicalendar, my install is here. I'm trying to get the cell background to change according to the text in the days event.

ie different class for cell bg I have figured out how to change the html in the template but im not sure how to carry this accross. Code:

View Replies !
Conditional Statement
I have made pages to create databases and the db gets created, but if i specify a not null auto_increment ,primary key the script ignores it and just makes the column a int column. Code:

View Replies !
Perform Conditional
I'd like to check these two conditions:

if ((is_page() or ($category->cat_ID === $cat)){
do something
}

but keep getting an "unexpected {..." error. If I do this, it works fine:

if ($category->cat_ID === $cat){
do something
}


View Replies !
Conditional Onclick
<input type=button value="<?php echo $button_caption ?>" onclick="if (verifyChange() == true) {location.href=$_SERVER['PHP_SELF'].'?homeinclude=member&pageaction=signupok'}">

I get the "missing name after . operator" error.

View Replies !
Conditional Third Expression In For Loop
Is it possible to make expr3 $i++ under one condition and $i-- under another? Instead of having the condition outside the loop and having two loops. Or I could just use a while loop, I guess.

View Replies !

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