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.





Make A Dropdown Option Field For User To Select Date?


how can make a dropdown option field for user to select date?




View Complete Forum Thread with Replies

Related Forum Messages:
Dropdown Select Option
I've sort of hit a roadblock. I'm working on a user system using PHP and MySQL. Where I'm stuck is on the "Edit User" page where the admin or user can go in and change the personal information of a user. Here's the dropdown menu.

<SELECT NAME="NameSuffix">
<OPTION VALUE="">SUFFIX</OPTION>
<OPTION VALUE=""></OPTION>
<OPTION VALUE="Jr.">Jr.</OPTION>
<OPTION VALUE="Sr.">Sr.</OPTION>
<OPTION VALUE="M.D.">M.D.</OPTION>
<OPTION VALUE="Ph.D">Ph.D</OPTION>
<OPTION VALUE="I">I</OPTION>
<OPTION VALUE="II">II</OPTION>
<OPTION VALUE="III">III</OPTION>
</SELECT>

<?php print("$data[6]");?> Gets me the database value from the NameSuffix field. Let's say, for example the value is "Sr.".

View Replies !
Form That Allows The User To Select A Sorting Option.
I have a form that allows the user to select a sorting option. One of the options is a day of the week. (The table is a list of courses and their times/locations/days.) I can get the results to sort by user option, but how do I make the days sort chronological rather than alpha if this is the option selected? This is my code:

$query = "SELECT * FROM classes ORDER BY '$schedule'";

The user selects which way to display the data through the $schedule variable.

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 !
Select Statement On Date Field By Specific Year
i am using dreamweaver 8.2, php and mySQL db. my questions is how can i filter a set of records on the date field by only giving the YEAR as the variable. what i want to achieve is a list of listings by year.

SELECT *
FROM tblProperties
WHERE dateAdded LIKE '%2006'

View Replies !
Option Dropdown
Im trying to create a "Select all" search Option dropdown form , but the options are stored the the database. Heres my original form:

<option value="<? echo $rst["id"]; ?>"><? echo $rst["cat_name"]; ?></option>

Basicly it has 20 or so options,  but no "search all" option. I had a play and came up with this but its adding the "select all" option every 2nd field:

<option value="<? echo $rst["id=all"]; ?>">All Categories</option>
<option value="<? echo $rst["id"]; ?>"><? echo $rst["cat_name"]; ?></option>

View Replies !
Select <option> </option>
I have this script in a form, it is trying to send a selection from the from to the next page. But the proble is that if the selection has a space in it, it only sends the first work to the next page. Code:

View Replies !
Dropdown Date Selector That Automatically Selects Todays Date
Does anyone have a PHP generated dropdown date selector that automatically selects todays date on page load that i can pinch?

View Replies !
<select> Option
I know PHP is a server-side language, so it's not client-sided. What I want to do is have a <select> dropdown with options and I want the page to refresh itself and display some information on that option. The problem is that since PHP isn't client-sided, I don't know how to get the value of the selected option and display the relevant info on that option. Any ideas on how to do this with PHP?

View Replies !
Select Option
I want to load textarea's value in drop-down box.
In first page, such form is existed.

<form name="form1" method="post" action="next.php">
<textarea name="dayList" Id = "dayList" cols=20
rows=10></textarea>
</form>

in text area there's one column of values.

in "next.php", put values of 'dayList' in select option. I made a code
by myself. However, as you see, it's just nonsense. How can I modify
this? Code:

View Replies !
With Select Option
i am developing simple site for php where i put onle selct box,I have to check the value from the select box and put it in the database.I am having problem that if a value is alrady selectd , if you want to select it agin i have to prompt up the message that value is already selected.

View Replies !
Right Option In Select Box
I've a small problem but I can't fix it. When I want to edit an article I click on the article and you get redirect to a new page where you can change te values (title, category, author, etc). The categories are in a select box and I want to, when you edit an article, that the right category from that article is selected.

<select name="category" class="category">
<?php $allCategories = getAllCategories();
foreach ($allCategories as $category)
{?>
<option value="<?=$category['CATEGORY'];?>"><?=$category['CATEGORY'];?></option>
<?}?>
</select>


This is the MySQL below (a part of it) when I edit a page.

else
...............

View Replies !
Make A Dropdown-menu Filter?
I have a dropdown menu which is supposed to filter a table to show results for professionals, students or all. But I don't really know what I'm doing.  This is what I have so far. Code:

Initially, I was able to filter for students or professionals, but since trying to have an all option (students and professionals) it has gone to pot, and I keep getting errors.  I know that my quotation marks are not right, but I can't think of a solution. I would be more than happy to see any ideas, even if they are completely different to mine!

View Replies !
Default Option On Select Box
I need to make a field in a admin form to be a drop down select box. I have the field right now as: PHP Code:

View Replies !
Drop Down Box With Select Option
I have a couple of drop down boxes which you select the option you want, that value is then stored in the database. If you make a mistake there is an edit option which once clicked shows the form with the information filled in/selected.

However my problem is that when you edit, although the current option which was previously entered into the drop down box is set as the starting value, which is disabled, if you dont change the drop down box the value is deleted rather than held as it hasnt changed. Code:

View Replies !
Remaining Value For Select Option
i've used $_SERVER[PHP_SELF] , so my form and script are just one file .
when a user click the submit and have some errors the sript reload again ,
for a reloaded script i've put :(for exaple)

<input type="text" name="username" value=$_POST[username] />

so when it reload the last information the uer has typed won't be delete.it stays.

i want to do the same with my "select menu " , i don't know how , the select menu reset when script reload :(example)

gender :
<select>
<option value="">select one</option>
<option value="m">male</option>
<option value="f">female</option>
</select>

View Replies !
Select/option Action?
I am trying to figure out how to click an option in a select menu and have that option act as a hyperlink/form submit without a submit button. Here is an example of what I am trying to do: Code:

View Replies !
Selecting Option In Select?
I am trying to populate a drop down list from values in an array, and compare a $_REQUEST or $_SESSION value to each of the array values. If they are equal, then the option in the drop down menu will be selected. Can't get it to work... Here is my code:

View Replies !
Select Data Into Option Box
Say I have a form

<select name="Birth_Month">
<option value="">(Month)</option>
<option value="01">Jan</option>
<option value="02">Feb</option>
<option value="03">Mar</option>
<option value="04">Apr</option>
<option value="05">May</option>
<option value="06">Jun</option>
<option value="07">Jul</option>

The user selected one field, and that field's value is stored in the mysql database. My question is, if the user wants to come back to the page, and select "Edit". .. Then he/she should get a form that his Birth_month's value has already been selected for him. I did the select * query

<?php echo "value="$row[6]"";?>>

The $row[6] is the row that contain that user's month info. But I don't know how can I use that row to insert into those option box?

View Replies !
Select Option And Htmlspecialchars
I'm trying to create a dropdown option that when selected goes to the url specified, I would also like specific data posted based on the selection Code:

View Replies !
Drop Down Select Box Which Contains The Option
I have a drop down select box which contains the option other beside this i have a tewxt input called "other_option " that can be filled in if other is selected. On my insert page this is the code i am trying to use to determin what goes into the database Code:

View Replies !
Date Dropdown From Mysql Date Entries
For the PHP gurus out there, here is what I want to do: create a dropdown list of available dates from a mysql database date entries. But the dropdown/s should have 3 separate fields in month, day and year which in effect shows only those months, days and years that have corresponding entries from the database.

Planning to use this in the archive section of an online news publication so people can select issues to view via dropdown list that have corresponding entries only.

View Replies !
White Space In Select Option
I'm having a problem with a <select><option> which has white space in
values...

When I post the data I only get the first word (up to the white space).
"Testing white space" becomes "Testing" after posting

<select name="descr" id="descr">
<option value=Testing white space>Testing white space</option>
<option value=Testing white space two>Testing white space two</option>
<option value=Testing white space th>Testing white space th</option>
</select>

I am using form method = post and have also tried method = get

How do I get the full string from the value field.

View Replies !
Getting Right Order Of <option>s In <select> After Submit
I'm trying to emulate part of our client-server application as a web
site so customers can use it, and I'm stuck when it comes to
re-ordering items in a list.

Basically we have a list of available articles ("availableItems") and
a list of articles already in an issue ("selectedItems"). What I want
is to be able to move articles freely between the two lists and then
on submission add them to the issue (which I can), but also move items
in the "selectedItems" list around so that they can be re-ordered
(i.e. I want the customers to be able to change the order in which the
articles appear in the issue).

I can do both these things on screen (i.e. I have written Javascript
to move them from one box to the other (add/delete them from
"selectedItems") and to move individual articles up or down the list
of articles in the issue. Befor submitting I run a Javascript loop on
the list to select them all, from top to bottom. On screen it always
selects them in the right order (i.e. top to bottom, no matter whether
I have changed the order of these items) but when I grab the array
containing the item id numbers it's as if the change in order had
never happened!!!

Newly added or deleted papers get added/deleted fine, but when I fetch
the array from "selectedItems" I always end up with the items in the
same order, with the latest items added at the end. However, being
able to change the order of these items is crucial for this project,
but so far I have been unable to do this and I haven't found any
information on how to grab the new ORDER of items.

Here's some of the code:

I retrieve the array like this:

/*
$ia_items_new = $_POST['selectedItems'];
*/

However, this still lists the items in the OLD order:

/* if ($ia_items_old) {
foreach($ia_items_old as $key => $value) {
//echo("<BR>Old: No.".$key." - ".$value);
}
}
/*

Populating the "selectedItems" box:

/*
print( " <td><select multiple size=&#3920;'
" );
print( " id='selectedItems'
" );
print( " name='selectedItems[]'>
" );
//Grab values if the information was found
$in_total_count = $objRSIssueBatord->RecordCount();
$counter = 0;
if ($in_total_count > 0) {
//Now put in an entry for every value in the batting order list:
//Get the recordset ready and extract data:
$objRSIssueBatord->MoveFirst();
while (!($objRSIssueBatord->EOF)) {
$counter ++;
//Get the variables and make string to describe items
$in_paper_id = $objRSIssueBatord->fields("bip_paper_tracker_id");
$is_jsp = $objRSIssueBatord->fields("jsp_code");
$is_customer_no = $objRSIssueBatord->fields("pap_customer_no");
if (!$is_customer_no) $is_customer_no = "N/A";
$is_author = $objRSIssueBatord->fields("pap_author");

View Replies !
Simple - UD Function With Select / Option
As you might guess I am completely new to this language. Maybe I get some
help here.
I try to execute a user defined funciton from a select option in a document
to read a file
into an array without using a submit button or anything else.
like this:
<select name="sel[]" onchange="<?php ReadFile(DependingOnValue);<?" >
<option value="1"> 1st Quarter </option>
<option value="2"> 2nd Quarter </option>
<option value="3"> 3rd Quarter </option>
</select>

I know I could use Javascript instead. But I am sure there is an easy way
doing in PHP.

View Replies !
Keeping Select Option Value Selected
I'm trying to learn how to keep the value "selected" once a form is set to read the values and then f-write them (all within a loop). The part that's giving me a problem is the part which would return the value of the form as "selected". PHP Code:

View Replies !
Multiple Select Box With Selected Option ...
first of all I have three tables (tournament_game, umpire_game, umpires). Updating tournament_game umpires, each game may have from two to four umpires, and those umpires can work from one to n number of games, that's why I'm using connection table umpire_game. I'd like to get selected multiple select box of umpires in game, it could be two to four options, with all umpires listed as options example:

<select name=umpire_game[] size=10 multiple>
<option value=$umpire_id>$umpire_name</option>
<option value=$umpire_id selected>$umpire_name</option>
<option value=$umpire_id selected>$umpire_name</option>
<option value=$umpire_id>$umpire_name</option>
<option value=$umpire_id selected>$umpire_name</option>
<option value=$umpire_id selected>$umpire_name</option>

PHP Code:

View Replies !
Select Option Stays Selected
I have a normal drop down menu:

<select name="status" class="db_list_text">
                    <option value="All" selected="selected">All</option>
                    <option value="True">Active</option>
                    <option value="False">Inactive</option>
                  </select>
The idea for this is for the user to select either true or false and then to click submit to find data that matches either one. The coding is in the same page so the form basically just reloads the page and grabbes whatever info is requested. How can I with PHP, make it that the dropdown stays on the selected option when the page is reloaded?

View Replies !
If/Else Statment Within An Select/Option Group
I want to create an update query in a form so that I can update my groups attendance. The variables 100% are working and are pulling the correct info.  In the update attendance column, I would like an If else statement that says if the attend_status == present echo  SELECTED VALUE="", so that the pull down menu will display the current attendance value. From there I will select the new update attendance info and then submit it using an update query.

Below is the code. I am running into other problems with the quotation marks in such because this is all located within the <php> tags. Code:

View Replies !
Form Auto Select Option
I have a website that has a contact form with a dropdown list of names. I would like to code it so that when a user selects a person's name from another page, that when it brings them to the contact form, that name is automatically selected in the dropdown list.

View Replies !
Slide Bar To Select An Option On A Range Of 1 To 10
how on some surveys they give you a range from one to ten, where one is really bad and ten is really good. well, i am trying to code something like that where it is an arrow that you can move along a bar to select a number within that range. does anyone know if this can be done with php? and if so, how?

View Replies !
Detect What Option The User Selected And Then Direct That User To The Selected Page.
Quick question regarding HTML forms and select fields. I want to be able to detect what option the user selected and then direct that user to the selected page.

<select>
<option name="1">1.html</option>
<option name="2">2.html</option>
</select>

when the user selects, 1.html, it'll direct them to http://www.domain.com/1.html same with 2.html. I wasn't sure if this was done with PHP or Javascript, if its possible on both, which is better?

View Replies !
Convert CSVs To Select Option Values
I was just wondering if someone could point me to a good web resource that could help me figure out how to convert a string of comma separated values (being pulled from a database) into a select menu (pulldown box) so that the values from the CSV would automatically fill in the displayed text area of the option tags as well as the value attribute so the value selected could actually be passed as a variable.

I imagine it has something to do with converting the CSV list into an array using substring parsing & then dynamically building the array from the elements of the array, but I just haven't been able to put it all together yet. If anyone is familiar with anything published on the web that might help, I'd be deeply appreciative.

View Replies !
Using Database Data For SELECT OPTION Statement
I want to use a <SELECT> / <OPTION> setup, and pull the data from a mysql database. I have done that, and don't necessarily have a problem with that. My problem is the database will have duplicate information in it, how do I only select one of each unique value? Code:

View Replies !
Automatic Selected Option + Select Menu
When the below menu is selected from it is processed by PHP code(PART II) I want the selected option to then be displayed automatically. However, the bottom option is automatically displayed. Code:

View Replies !
Dropdown Populated From Mysql Field
I'm looking to create a drop down box that displays a field from a a mysql DB so that i can list all the names and when I select a name from the list it selects that record.

View Replies !
Select Box - Assign A Class To Each Option To Give Background
I have a select box coded that displays MySQL data as options in the pull down menu. What I need to know is if and how I can make it so that each option has given background. Can I assign a class to each option? The code for my select box looks like this: Code:

View Replies !
Make A Form Where The User Can Log In And It Would Check If They Were A Valid User
i have created a user registration script where when u fill out the user name and password, it fwrites it to a txt file on the server. Now, my problem is. I would like to make a form where the user can log in and it would check if they were a valid user or if their username and password matches, how would i go about doing this.

View Replies !
One DROPDOWN SELECT Control Can It Fill In 2 Textboxes?
I have a form with text boxes and a dropdown menu with names of cities
The adjacent textbox fills by the help of a Javascript function.
My question is, how to realize the purpose of filling the adjacent texbox
for zip values. Code:

View Replies !
Auto Select Dropdown Lists From Db Values
I want a simple HTML drop-down list like this: Code:

<select name="select_1">
<option name="option_1" value="option_1" selected="true">
<option name="option_2" value="option_2" selected="false">
</select>

to be able to automatically select a value according to a value in a table in the database. For example, if a MySQL table has a field named "field_1", and one of the rows has a value of "option_1" in that field, I want the list (using PHP of course) to automatically select the option name "option_1".

View Replies !
Change Record When User Chooses Option From Listbox
I have a combobox which has different peoples names which are pulled from fields in a database. Can anybody please show me some code that will change the recordset so say for example there were two records in the DB with three bits of data name, number and telephonenumber:

John      10      01234567544
Frank     34      07883922332

and somebody selects john from the select box that in the two fields it shows 10 and 0123...

and 34, 078839..... if they select frank.

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 !
Select Both Field Name And Field Value- Mysql ?
What function to use to select both field name and field value from a mysql table ?

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 !
Insert Date To Database Using Dropdown Boxes
I be able to insert the date into my database if i have 3 dropdown boxes wherein it contain the month,day & year. i know the basic of inserting data into my database but with this 3 dropdown box i don't have any idea. after submitting, the data selected on these 3 boxes shall be in one field in my database with fieldname Date.

View Replies !
Store Date In A Date Field In My MYSQL Data Table
I have a form with a feild that when clicked on pops up a calendar which I can select a date I wnat to insert into the field. The date inserted displays "03 Apr, 2007". I want to store that date in a date field in my MYSQL data table, a field named "f_date" set to date type.

When I save the record the data field "f_date" displays "0000-00-00" which I take it the date input is not getting inserted to the table. My insert field code is PHP Code:

<input name="f_date"  type="text" class="bodytext" id="f_date" onclick='scwShow(this,this);' value="" size="15" />

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 !
Save Date To Table Field Date Type
I have a calendar picker on a form that fills a text box with  XX/XX/XXXX  date format. If I run a insert statement  the date field in the database shows 0000-00-00. If i change the field type to varchar  the correct format displays. 

What is the correct way to save a date to a mysql database?  Furthermore to query on the date  how about a select * from db_name where servicedate >= $startdate  and  servicedate >= $enddate  I supose this will not work
Any pointers?

View Replies !
Formatting Date From MYSQL Date Field
i've got a date field in my table, but the default format is YYYY-MM-DD... is there any way i can pull the date out of the database and format it differently... like DD.MM.YYYY or like April 13, 2003?

View Replies !
How Can I Make A Field Not Required
I have a php form that links up to an Access database where all of the fields are required and one of the fields asks for a date for females only. I can't figure out how to not require a value for this date field (first_day) if the person entering the form is male. I also don't want to have to put in a real date for a value if the person filling out the form is male, because then that means we have inaccurate data in the database. Here is some of the code I'm working with. Code:

View Replies !
Date() Question - Minus One Day Of The Return Date Choose By User
I have a date function, that gets today's date. Then my user can choose a date for the return date. I need to minus one day of the return date for a date_flag , but having trouble. PHP Code:

<?
$date_book = date("Y-m-d H:i:s");

$date_return = $_POST['date_return']; //Returns a date like this 2007-05-25

                         // needs to be date_return - 1 day like 2007-05-24
$date_flag  = mktime(date("Y", $date_return), date("m", $date_return), date("d", $date_return)-1);
?>

View Replies !
Make An Array With All The Values From The Field
I have a mysql select query and got it in an array

$query = "select persid from reactie";

$result = mysql_query($query);
$query_data = mysql_fetch_array($result);// Haal de gegevens uit de
tabel

NOW I WANT TO ECHO I"T:

echo "$query_data[8]";

But only the query_date[0] is valid. What am i doing wrong? there are many
more values in the table. I want to make an array with all the values from
the field "persid" in the database.

View Replies !
Empty Field In CSV = Make Entry For Them
I'm tryong to learn PHP, and have been able to get a form up writing to a CSV. I want to then be able to pull the CSV into Excel or even list the contents on a website. I have been able to do this, however when a field is left blank it does not write anything to that line in the CSV. So, because of this the line is shorter, and the field's do not line up, but are shifted the left.

I've considered checking for an input, but sometimes they'll have to be left blank, so these wouldn't work for my application. I've been searching for hours, upon hours and found no solution that has worked.

Basically what I want to do is insert maybe a space, or at least make sure the field is there. A space sounds like the best thing, then we've got no false data, if anyone has suggestions please let me know, and keep in mind I'm a newbie! LOL Here is my code: .....

View Replies !

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