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.





Select List - Edit Form


For a couple of days I have been trying to make an edit form that remembers the initial values a user entered. The edit.php page has a few textboxes and a few dropdown/select boxes. The textbox part works fine and comes from a database. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Add A List Box To A Form So That Users Can Select A Category.
i want to add a list box to a form so that users can select a category. The categories are held in a database with two fields, catid, and category.

How can i populate the list so users select the category name, but when it enters the choice it enters the catid...?

View Replies !
Retrieving Contents Of Select List On Form Submit
On an HTML form, I have a select list that is fed dynamically with
detail records when the master record is displayed on the form.

There is also a second lookup list, and want to allow the user to
dynamically select from this list and add to the first list. I also
want the user to be able to dynamically remove from and reorder the
first list. I think I can do all of this with JavaScript.

The question I have, is how can I retrieve the contents of the first
list when the user submits the form? I need to get it back into a php
array so I can update and add the proper database records.

View Replies !
Dealing With List (multiple Select) Submissions From A Form
If I have this in a form, how can I deal with the $_POST result if multiple items in the list are selected? I've been searching the net for such answers, but I think I'm searching for the wrong things as I can't seem to find what I'm looking for.

From what I've tried just, only the last selected item in the list goes through on $_POST

I basically want a list of items, which would have a certain operation done on them if selected on the following page.. but need to get ALL of the selected items first! Code:

View Replies !
How Do I Edit A List Of Files Associated With A Product ?
-I wrote a script that you use it to add products in the database.
-Each product is associated with files.
-In the Form to add the product you have to enter the product name in a
textfield and below there are $no_of_add_file filefields.
$no_of_add_file is an integer that determines the Maximum number of
filefields that you want to associate/add for each product.

So it succesfully adds the product and the files in a database and the
filesystem.

The problem I am trying to solve is how am I going to edit those files in
the product.
If you know what I mean... and you have done something like that or you know
a url or script that does that, pls let me know.
What I need mostly, is not the PHP code but the logic and what are the
possible ways of doing something like that.

In the database i have two tables that this script needs:
One is the products and the other the files.

Products : product_id, product_name
Files : file_id, file_name, product_id

View Replies !
How Does Myadmin List Field Names To Edit?
I'm trying to setup an edit page so that the user can edit any data he entered earlier.
Say he entered all his stuff in and found a mistake and he wanted to go in and make a change. Simple UPDATE command. Code:

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 !
Edit Data Based On Select
What i am trying to do is based on the selected item gather data from the database and edit it. I have the drop list populated but i dont know how to get it so that when a user selects an item to generate the page with the data. Code:

View Replies !
Edit Form
I have a php form that displays information from a database based on a mysql query. Four of the form fields are images that are stored both in the db and in a folder on the host.

What I want to do is to be able to update the images in each of these field, for example, click an update button that allows you to reselect a new image when submitted this would delete the original image and replace with the new. I know how to unlink the file to remove the images but cannot find a way to do what I need.

View Replies !
Edit A Form ?
i have a form.in which user input there information. now when user click on submit button it will open conformation page if user found some mistake then user can edit there information.

what i want is that when user click on edit button 1st it will redirect to main form page & then automatic fill all information which was filed by user.

View Replies !
Select List
I'm creating a form that has three select lists. The first one has two values EMAIL and SMS. What I want to do is have the two other select lists (named EMAIL and SMS) work so that if EMAIL is selected only e-mail select list can be altered and vice versa with the SMS.

How can I do this? I know to use disabled in <select> -tag, but how can I check the what the value is (and the value changes) and then act acording to it?

View Replies !
Edit XML Like A DB Woth Web Form?
I have a site that takes info from a form and adds it as a record to an
XML file (RSS format), using the XML as a light-weight db.
Now I need to build a web-based management app for the data in the XML
file, where the user can grab a record from the XML file, edit it, and
save the changes back to the XML file....

View Replies !
Edit XML Using Html Form
I have simple XML:

<myXML>
   <t1>My main Title</t1>
   <t2>secondary title</t2>
   <content>All kinds of good content</content>
</myXML>

All I want to do is make a simple CMS that can update the content inside the 3 inner nodes. I don't need to change, add or delete nodes. I thought of echo-ing the content to 3 html form inputs and fwriting to a new XML file to overwrite the old one using post method. Does this sound correct in theory? Does anyone know of an existing example of this method?

View Replies !
Edit Profile Form
on my site the users can goto the control panel and edit there profile (age,location etc) from input boxes and drop down boxes, but if i just for the heck of it press the "update profile" button WITHOUT putting in the correct data it is all lost (no input in the input boxes defaults to zero in mysql)

what would be the best way to only update mysql when the user input the data, i have attatched a screencap of some of the fields Code:

View Replies !
Edit Form Validation
i have an edit form which as a validation code to check if the new parent category/subcategory is not yet existing in the database. apparently only my parent validation code is working, but my validation code for the subcategory is not working. Code:

View Replies !
Edit Images In Form
I am trying to perform an update on the four image fields. When you select the image it works without a problem.
The problem is as follows:

If for example you only wanted to update image one, the selection of the upload works without a problem and it posts the filename to the database, the filename for image one, two and three is changed to array. I have tried loads of things and cannot get around this.

What I want to do is basically if only image one is selected for update only that field is updated and the other 3 are left as they are.

View Replies !
How To Create An Edit Form
<?php

// check if id is passed to this routine
if (isset($_GET['id'])) {
// if yes: remove harmful tags and save the passed id in variable $id
$id = strip_tags($_GET['id']);

//required file for database connection
require("config.php");
echo "<table border=&#391;'>";
// construct SQL statement
$sql = mysql_query("SELECT *FROM iteminfomation WHERE ID='$id'");
$sql1=mysql_query("SELECT NameOfTools,Brand FROM listofitem WHERE ID='$id'");
$information1=mysql_fetch_array($sql1);
$information=mysql_fetch_array($sql);

echo "<table border=&#391;'>";
echo "<tr><td >NameOfTools</th><td >Brand</th><td>date</th></tr>";


echo"<tr><td>{$information1['NameOfTools']}</td>
<td>{$information1['Brand']}</td>
<td>{$information['Date']}</td>";
echo "</table>";
}

View Replies !
Edit Form With Combobox
I've created a form which include text field, radio button and comboboxes. When user needs to edit the form, it will be loaded with the current values, and user can edit it by changing those values. The problem is: If the changes is within the combobox, the value selected will be as per the selected one. But if there are no changes within the combobox, when user click submit, it will only save the first word from the combobox. Below is the coding that I've used:

<tr>
<td><strong>Person In Charge (PIC):</strong></td>
<td width="31%"><select name="pic" onChange="showValue_pic_others();">
<option value=<?php echo "$row[pic]" ?> selected><?php echo "$row[pic]" ?></option>
<option value="Dr. Marina Tan">Dr. Marina Tan</option>
<option value="Ms Amy Masni">Ms Amy Masni</option>
<option>Others</option>
</select></td>
<td width="33%"><div id="pic_others" style="position:relative; z-index:1; visibility:hidden; width: 117px; height: 21px;">
<input type="text" name="pic_others" id="pic_others">
</div></td>
<td>&nbsp;</td>
</tr>

If I didn't edit this combobox, the value that is submitted by the edit form will be the first word "Dr." for "Dr. Marina Tan" and "Ms" for "Ms Amy Masni".

View Replies !
Form To Edit MySQL
i have a script to update (edit) entries in a MySQL databvase that i got from a mentor: it loops through every field in a specified row number and prints it into a pre-populated form. The problem is this that i don't want to display every row the same way (i would rather display a photo than it's name, and for a larger text field i would like to display the text in a larger text box). His solution seems pretty smooth :

"foreach ($dd as $field=>$value)"

my thought was to do a case switch, but i don't know how to set that up, any ideas?

View Replies !
Edit Form Page
i have a edit form for my brand items and one of the items that i may need some alidation is the brand name. my problem is, i need a validation code for the brand name, wherein if the brandname was changed it will execute this validation to check if there is already an existing brand name but if the brandname was not changed it will not execute this validation code. currently this the validation code that i am using:

$sql_brand_name_check = mysql_query("SELECT brand_name FROM engsoon_brands WHERE brand_name!='$brand_name' AND bid!='$bid'");
  $brand_name_check = mysql_num_rows($sql_brand_name_check);
 if($brand_name_check > 0){
 echo '<script language=javascript> alert("brand name already exist.<br>use a different brand name!");top.location = "brandsmngr.php?id=3&bid='.$bid.'";</script>';
 unset($brand_name);
 exit();

View Replies !
Edit Form For MySQL
I have a php form that encodes the responses to various <Select> field drop down menus as numbers (e.g. 0 to 50), and then posts the data to a MySQL table. I am trying to implement a form to allow editing of the data already in the table. I can read the data out of the database without trouble, however I am having trouble figuring out a way to have the appropriate option in the <Select> fields chosen to reflect the data already in the database.

View Replies !
Select List With A Loop
I want to accomplish a function that creates a select list with a loop of results from the DB, I have that, it is: PHP Code:

View Replies !
List Box Multiple Select
I am trying to create a drop down list that permits a person to select multiple items from the list and have the results posted on a results page. I am using Dreamerweaver MX, PHP and a MYSQL database. I was able to select multiple items but only the last selected item would be displayed. I tried to modify the list box code and now it returns nothing. Code:

View Replies !
AJAX Select List
I've been looking for an Ajax example wherein a dropdown list is populated based on a previous selection. I.e. Select List 1 - "Choose Country" - based on this selection Select List 2 would populate with Cities in that country. Found a way to do it using multiple txt files which hold the Select List 2 options, but I would prefer to use PHP MySql to populate both lists.

View Replies !
Multi-select List
I have a multi-select listbox created (and processed via PHP). As such I named it with braces in the name, like:

<select name="multilist[]" size=10 multiple>

However, I can't get javascript to reference the listbox when I name it that way (I need the javascript to dynamically insert/delete items from the list). I had originally named the list "multilist" without the braces and the javascript worked fine, and it let me multi-select, but php would only see the last item selected.

Based on hints I read elsewhere, to enable php to process the multi-selections into an array, I renamed the list with the braces [] but now the javascript simply does not work -- it will not insert data into the list. Is their any trick to the control naming I need to know?

View Replies !
Multiple Select List Box
I have a task where I have to fetch datas from mysql and display it in the multiple select list box. I have fetched the datas and it is getting diplayed correctly in the multiple select box. I have used some thing like this.

print "<select MULTIPLE SIZE=&#396;' name='db_test[]'>";
while($row = mysql_fetch_object($handle))
{

if($num 0) /*num is number of rows*/
{
print "<option value='$row->db_name'name='$row->db_name'>".$row

View Replies !
Multiple Select List
I have a form that inserts it's values into a table in a mysql database.. i also use another form to edit the contents of that table...

My problem is that i have a multipe select list ... i imploded it's values into the table like this:

$employees = implode(',',$_POST['emp_name']);

that worked fine ... but i can't figure out how to make the same values selected on my edit form's list?

View Replies !
Getting To Match & Select From List?
I have a list of values, where $list = ___, then $email = ____. I'm carrying over $list from the previous page as a hidden element of the form, and I want the php code to match the value of $list and replace it with the value of a corresponding $email. 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 !
Select List From A Database
I'm trying to dynamically generate a html select list from a MS Access database using the code below:

<?php
$conn=odbc_connect('customer','','')or die('Could Not Connect to ODBC
Database!');

$queryexe="SELECT * FROM types";

$rs=odbc_exec($conn , $queryexe)or die("Query failed: $sql<br />Error:
".mysql_error()."<br />");

echo "<SELECT name="typeId">";
while(odbc_fetch_row($rs))
{
echo "<option>".odbc_result($rs,"typeId")."</option>";
}
echo "</SELECT>";
?>

View Replies !
Mulitple Record Form Edit
I'm working on a form to be able to edit multiple records at the same time but only the first record is showing the correct details. Code:

View Replies !
Form To Edit Html Code
I have a html page with tables and cells. 9 cells with text in them with "onclick=MM_setTextOfLayer" for each name in the cell/tables.  And I need to make an php form that will change the name in one of the 9 designated cells/tables (by choice) and the value of the onclick in the src code. And over write the old stuff.

View Replies !
Edit Delete Form And Quotations
I have a form where I add a lot of ' and " for feet and inches into MYSql and most of this works fine except when I go back to the Edit/Delete Form.

It stores the ' and " in the database, reads and outputs the ' and " on my page but when I use the edit/delete form it cuts off at the '. Is there a simple solution to this on an edit/delete form ?

View Replies !
Creating A Direct Edit Form
I want to setup a form that will put the field data directly into a webpage.  I figure the script I need is similar to a forum script, but I can't seem to find a good one.  Plus, the tutorials on forums at phpfreaks have been removed. The idea is to allow users of the site who are not code-savvy (or do not have Dreamweaver) to contribute (ironically the name of the software that allows this).

View Replies !
Edit Form & Drop Down Box Issues
im trying to get it to work with a drop down box. So that when i use the page it will automatically select that option in the drop down. If that makes sense? Code:

View Replies !
Edit Form Not Displaying All Info
I have an edit form when I run the query in SQL all the information is displayed when I run it PHP the first word then nothing shows up. For example if the data in the field says : 2569 Nutley Street when I run it in PHP it only displays 2569 and nothing else. Code:

View Replies !
How To Edit An Entire Table Using A Form?
Currently I am able to create forms to update a mysql table. I can display information from my tables no problem.

I have since been trying to figure out a way I can edit mysql entries for a table on one page. Say I have a table with the headers

'id' 'header' 'url' 'content'

in a table called 'news'

How can I display all the rows from this table in a form that can be edited and re-submited.

I would also like to be able to delete entries by ticking a check box next to that entry. So I could in one go select 2 or 3 for deletion and update others and have it all update the database with one submit button at the bottom of the page. Code:

View Replies !
Edit Form Using Drop Down Boxes
I have a form that uses drop-down boxes to save information to a MySQL database using a php script I wrote. That works fine, but the problem comes when I am trying to edit the information in the database. I have an "edit form" that pulls the values from the database and displays the fields in the fields accordingly. I am having a hard time figuring out how to populate the drop-down boxes with the value from the database. I want the "option selected" tag to be the database and be able to still have the rest of the options to select from.

View Replies !
Edit Form, Data Not Re-fill
im doing a edit profile page. the page would pull out data frm mysql and populate the forms respectively.

user will edit and update their profile. The page would then validate the value in the form. if there's an error, it would prompt the user. when this happen, the form do not retain the newly entered value but instead re-display what is pull out from the database.. how do i retain the newly entered value in the textbox? Code:

View Replies !
Select List/Menu Using PHP And MYSQL
Here is my code:

<select name="country" class="sidelinks">
<?php
do
{
?>
<option value="<?php echo $row_AllCountries['country_ID']." ";?>"<?php if ($row_AllCountries['country_ID'] = $acountry) { echo "selected"; }?> >
<?php echo $row_AllCountries['countryname'];?></option>
<?php
}
while ($row_AllCountries = mysql_fetch_assoc($AllCountries));
?>
</select>

A few words to describe:
-$row_AllCountries['country_ID'](get from MySQL) is a unique country ID number
-$row_AllCountries['countryname'](get from MySQL) is the name of the country
-$acountry is the country ID number that i want to be selected when the form loads

I have all the values and country names named OK...the only problem is that when the form loads it selects the last country.

View Replies !
List Data From A Select Statement
I have a page where I am trying to list data from a select statement. However, I am only getting one record from this SQL statement in a PHP script, but over 3200 records with the same statement in phpMyAdmin. Am I doing something wrong? PHP Code:

View Replies !
How Do You Select Developers From Members List
The member list at PHP Builder is quite large and lists some 2500+ coders in USA. How can we identify:

1. experienced php/mysql web developers - 2+years
2. good client relationship history - ratings or referrals
3. preferably located in or near Houston, TX
4. Preferably experiened with osCommerce backend development

View Replies !
How To Process Multi-select List
I'm not sure if my post should go here, but since I am using PHP, I figured I'd start here.

I have a table of choices that a user can select from, and can select as many as they want (it is for searching). I originally had a dummy list with checkboxes set up, and of course the name="name[]" was an array to capture each ID checked off, so I could easily use 'foreach'.

However, when the list was finalized, it has over 100 choices. Even half that would be too much for checkboxes. My two questions are:

1) Is there an alternative to a multi-select list, which is not that intuitive to use nor easily accessible?

2) How do I set it up so I can capture the values? I can't seem to find this answer anywhere. Is it because multi-select lists are to be avoided?

View Replies !
Keeping Select List Persistent
I grab data from an Oracle database and create a select list as follows:

while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
   print '<option value="'.$row[0].'">'.$row[1].'</option>'       
  }

The problem I have is that my error handling functions send the user back to the same form if there is a data entry problem. When this happens, I get an error that the login information (that I use to build the select list) is incorrect; basically because it is gone.

Rather than going back to the database each time the user is sent back to the form for a data entry error, is there a way to make this list persistent.

View Replies !
Multi-select List Boxes
I'm trying to allow the user to make multiple selections in a date list box. The list box displays the numeric days in the month. The offical scooty I can find on this is to do something like:

$theDays = $_POST['lboxDay'];
// get the data from the list box named "lboxDay" on the previous form.

$expDays = explode (",", $theDays);

This explodes the post data into an array of all the days selected in the list box, which are supposed to be delimited with a comma (the HTML standard). So, I should then be able to see those days with something like :

echo "<br />Day 0 = $expDays[0]";
echo "<br />Day 1 = $expDays[1]";
echo "<br />Day 2 = $expDays[2]";
.
.
.

View Replies !
Input And Output In Same Form With Edit Facility
i am using MYSQL with php. the databse is containing the deatils of the stock of each supplier. i want to update the stock so i will enter the name of the dealer.i should be shown the existing stock and from ther only i should be able to edit the stock to update database.

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

if $_POST

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

else if $rows

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

View Replies !
Encrypted Passwords And User Edit Form
rather than just storing my user's passwords, i store an MD5 hash instead.

$sql = "select * from users where user='username' and pass='" . md5('password') . '";

what i'm wondering is how to handle the user edit page where an admin can update a user's information. if i put a password input field on the form, i cannot pre-populate it with the password because i literally do not know the password.

should i just leave it empty and only change a user's password if the admin actually enters something in there? that worries me a bit because my admins might not be the brightest folks and it might confuse them.

View Replies !
Displaying A List Of Categories From A Database In A Select Box
Could someone please tell me why this outputs nothing

<select name=categories>
<?
$cat_array = get_categories();
foreach($cat_array as $this_cat)
{
echo "<option value="";
echo $this_cat["category_id"];
echo """;
echo ">";
echo $this_cat["category_name"];
echo "
";
}
?>
</select>

==========================================================

function get_categories()
{
//get the list of categories from the database

$conn = mysql_pconnect("localhost", "user", "pwd");
$query = "select * from categories";
$result = mysql_query($query);
if(!$result)
return false;

$num_cats = mysql_num_rows($result);
if($num_cats == 0)
return false;

$result = db_result_to_array($result);
return $result;
}

//A function that returns a query to the database as an array
function db_result_to_array($result)
{
$res_array = array();
for($count=0; $row=@mysql_fetch_array($result); $count++)
$res_array[$count] = $row;

return $res_array;
}

View Replies !
Trying To Select Names From A Drop Down List And Display Them
So, I already have the code written where I have a drop down menu with names in it. I want to be able to select multiple names from the drop down list and have them display in a table below the drop down menu. First off, I can't get one name to display, not to mention multiples. :p How may I accomplish this?

CODE:

View Replies !
How To Response Immediately When I Select The Drop-box List
Do you have any idea when I try to select a drop box list, the data
will show up in the following textbox immediately?

eg.

Name:
---------------
drop-box list | <- when i select one of them
---------------

Age:
---------------
Textfield 1 | <- pop up immediately
---------------

Address:
---------------
Textfield 2 |
---------------

View Replies !
Popup Window List Of Values To Select
What i need to do is bring up a popup window with a list of values(values looked up from the database). The user should be able to select one of the values from the list and the value then populate a text box on the calling form.

View Replies !
Insert Data From Multiple Select List
Am trying to insert data into a mysql database from a multiple select list. How would i do this? Code:

View Replies !

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