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 Complete Forum Thread with Replies
Related Forum Messages:
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 !
<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 !
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 !
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 !
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 !
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 !
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=ཐ' " ); 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 !
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 !
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 !
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 !
Time Remaining
I've searched the forums for a solution to this problem but can't find one that matches my needs. I'm wanting a time remaining counter to show when a item placed on a market ends (similar to ebay). I've set when the item ends as a future timestamp, now i need to calculate how many days, hours and minutes are left until that time, i can't figure it out.
View Replies !
Number Of Days Remaining
Im wanting to let users view something for 3 months from the date of joining, after this time it will be disabled and they will have to upgrade to get access again. I have read the information in the manuals regarding TO_DAYS but still cant firgure it out:PHP Code: SELECT m_usertype, TO_DAYS(DATE_ADD(m_joined, INTERVAL 3 MONTH))-TO_DAYS(NOW()) as days_left FROM members WHERE m_id = USERID How do i correct this?
View Replies !
$_POSTs Remaining Empty?!
In writing to the flat file, only the ||||||s and the date function are being passed through. For some reason, the $_POSTs remain empty, or at least don't 'write'... I have tried different ways of building the $line variable but...nothing Code:
View Replies !
Create A Dropdown Of Remaining Months
I am attempting to figure out how I can do the following: Take a date from a MySQL database like: 2006-06-01 (June 1, 2006) Then have a dropdown list of remaining months using for example todays date of 2005-08-23 This would product a dropdown like: 1 month 2 months 3 months 4 months ...... 10 months
View Replies !
Getting "true" Number Of Days Remaining ?
im writting a script, that alerts me when a set number of days are remaining to an event...(which im fine with!!!) The problem that i have, is the way that im getting the remaining days, the script is dividing the results by the number of seconds in the day... So say that today is the 3rd July and the alert is excuted at 1pm, the the script will return 1 day, if say the event was on the 5th July....logically thinking it would return 1 day, but phyiscally there are two days remaining. PHP Code:
View Replies !
Getting "Days Remaining"
I have written a program that gets the date, and compares it with a "Sale Date". If the current date is before the sale date (November 22nd, 2007), it will print "Sale is on!". If it is after, it will print "Sale is over...". $freestuffdate = "22-11-07"; $today = date("d-m-y"); if ($freestuffdate >= $today){ echo "Sale is on!<br />"; } elseif ($freestuffdate<$today){ echo "Sale is over...<br />";} I am wondering if there is any way to make a code that prints out how many days are left until the end of the sale. How can I tell PHP to subtract $today from $freestuffdate, so that it tells me how many days are left from the current date and the sale date?
View Replies !
Multiple Select From Listbox And Execute A Sql Query Select Statement
Supposing i have a html form with 2 listbox and i name it status and resolution. So it goes <select name='status[]'>... <select name='resolution[]'> Then i have a another php page. $status = $_POST['status']; $resolution = $_POST['resolution']; Now my question is, how do i do the sql query statement? mysql_query("SELECT * from bugs where status=$status and resolution=$resolution"); The problem is, i select 3 options form the status listbox eg. new, closed, duplicate. And from the resolution, i chose fixed, invalid.
View Replies !
<option> &
I have an array like the one below PHP Code: array( 1 => 'Apparal', 'Business', 'Game', ); How can i get PHP to echo out an <option> tag for each value in that array. I want the key to be the value of the option, and the value to be what the option is. <option value="key">Value</option>
View Replies !
<option>
If I know the text of an option (or the value) how can I get the option position/number? For example: <select name="numfontype"> <option value="AARVC___.TTF">Aardvark Cafe</option> <option value="Abduction.ttf">Abduction</option> <option value="Adventure.ttf">Adventure</option> <option value="air_mitalic.ttf">Air Millhouse</option> </select>
View Replies !
Option Value
I'm tring to concat 2 columns from mysql. Lot and Unit. I have tried everything to get my code below to work. <? $mysql= "select concat(lot,''-'',unit) as t from production where community= '$community' "; $query = mysql_query($mysql); echo "LotUnit "; echo "<select name="t" size="1"> "; while ($row=mysql_fetch_array($query)) { echo "<option value="".mysql_result($query,$i,"t").""></option> "; } echo "</select> "; ?>
View Replies !
Add Option Modifiers
I am working on trying to create an admin for a product catalog, the only problem i am having involves product modifiers such as the ability to add size and color to the product that can also increase the cost of the product. I was wondering if anyone would know a really good way of going around to do this, the only way I can think of is having a product option table that would hold the value of the modifier plus the cost plus the product id that this references too plus its own special id.
View Replies !
PHP GTK Option Questions
Before I invest more time in researching and testing I am curious if anyone knows for certain if a PHP_GTK application running on a Windows machine can communicate and interface with a remote database SECURELY? My plan involves creating a support system which would be a standalone application on a Windows Workstation. This application would query data from a remote database SECURLY and then support personal would be able to modify, edit, etc. data from the PHP_GTK application which would in turn update data in the remote database, again securely. Can a PHP_GTK application support this, security being the biggest concern?
View Replies !
Readdir & Option Value
more or less that is my problem: i'm making HTML <select><option> statement: if ($dir = @opendir("/the/directory)) { while($file = readdir($dir)) { echo '<option value="'.$file.'">'.$file; } } the number of options depends of number of files in directory. When user chooses one of this files(he chooses an option) i want to know what option he choosen.
View Replies !
Option Button ?
I want to create a form with 3 groups of 2 options buttons (radio buttons in Dreamweaver). Can someone helps me in sending links to PHP Reference ? Example: a > 0 Option(Yes) Option(No) b > 0 Option(Yes) Option(No) c > 0 Option(Yes) Option(No) Submit Button Action of the submit button: If option_a_yes is checked (...) then open html.
View Replies !
Option Values
From my experimentation there seems to be a difference when using values from an option value as apposed to an value by a check box etc. I can quite easily input data from a check box selection, but not an option value. Code:
View Replies !
Pagination Option
Below (A) is a portion of my pagination code where I specify the limit. What I'd like to do is add a select function (B) that will allow users to specify the limit. On change of select option, it should refresh with the new limit: Code:
View Replies !
Option Selection
I am making a Option Box (Drop down bar) for Gender, (Male,Female) and I want when they Select there Gener, and then hit submit, it Writes to to a Database. i have it set it up so far that it goes to another page to INSERT it into the Databse.
View Replies !
Option Value Remember
When a user clicks on a car the option box selects what car has been choosed, after filling the form in and if he has forgotten to type some info, the script echos what did he forget, and the prob is, that the option value disappears. How can i save the value or post it over? Code:
View Replies !
Put Attachments Option
how can i put a attachments option on my phpnuke forum i want people to be able to use attachments Mp3,wav.zip.pic.rar,and more. what im doing a forum so people can battle Beats on the forum by puting attachments and people can download the beat or if it is posible to be no download youst click.
View Replies !
|