Calling A Php Function From A Form Selection List

Apr 16, 2007

I have a function that will read records from the database and populate an area of my webpage based on a value selected from a list box.

I have got it to work fine if the user hits a submit button but I was wondering if it possible to perform the function dynamically each time the user changes the value in the list box.

View 1 Replies


List Box Selection To Display Record In Form

I have developed a database in mysql and php for contact management. I have programed in several older languages but am new to both mysql and php. I need to display information in a form but want to select the record from a drop down list either by typing or selecting from scroll.

Problem 1 first and last name in seperate fields so search in list box a problem because I can only select one field. Second... after selection of name in dropdown list how to tell the form to refresh to the record selected.

Third I would like to display contact information in a form on the top of the page (from the selection from listbox) and at bottom a list of touchpoints that pertain to that contact from the touchpoints table.

View 1 Replies

Populate A Drop Down List In A Form On The Basis Of A First Selection

I have developed a form to register a property in a db. The form needs the selection of a country and then based on that selection the selection of regions from the selected country. I have a program which allows selection of a country and then a region but it uses java script which I would like to avoid. I also just wanted one submit button if possible. Code:

View 14 Replies

Selection According Select List - Redirection Without Using Submit Button In Form?


I'm making a site, in which i want to make a select any option in select list. After selecting desire option, code should be sent to specific path which is my database file and this database file return all detail of any particular car.Is there any way to do this kind of redirection without using submit button in form.

View 2 Replies

Calling A Function As A Form Action?

Is it possible to call a funtion as form action?

View 5 Replies

Calling A Function From Form Submit?

I am trying to figure out how to call a function when a user clicks submit on a form. I have a sample script that I am writing where the user inputs there name, address, etc.. and then clicks submit and it inserts into the mysql database. I have successfully done this with form action to my adduser.php file, but I would rather have a single function file with adduser, delete a user, edit a user, etc..

here is my form

<form action="includes/customersfunctions.php?add" method="post">
name: <input type="text" name="name" /><br />
address: <input type="text" name="address" /><br />


The function will have delete, update, etc.. later

View 3 Replies

Calling A Function From An HTML Form In The Same File?

I'm trying to execute a PHP function in the same page after the user enters a text and presses a submit button.The first I think of is using forms. When the user submits a form, a PHP function will be executed in the same page. The user will not be directed to another page. The processing will be done and displayed in the same page (without reloading)Here is what I reach to:

In test.php file:

<form action="test.php" method="post">
<input type="text" name="user" placeholder="enter a text" />
<input type="submit" value="submit" onclick="test()" />[code]...

View 7 Replies

Calling Mysql String At Selection Of Radio Button?

i am calling 2 strings with the selection of radio is for company and another is for category...

Here's what I am doing...

PHP Code:
$v1 = 'checked';
$selected_radio = $_POST['category'];
if ($selected_radio = = 'v1')
if(isset($_GET['getkeywordsByLetters']) && isset($_GET['letters'])){
$letters = $_GET['letters'];
$letters = preg_replace("/[^a-z0-9 ]/si","",$letters);


View 8 Replies

Populate One List Box From The Selection Of Another List Box...?

I have a list box that reads category names values from the category table. I want to select a category name and populate the product list box with the names of products in the category.I have the code to populate the category listbox and the sql to populate the product listbox, but i'm not sure how to put them together (I guess calling a seperate php file and then passing the values back somehow?)

<p>Select the product category:<br />
<select name="prodcategory" onchange="javascript: form.action='reportmanual_getcategoryproducts.php';">[code]......

View 3 Replies

Populate One List Box From The Selection Of Another List Box?

I have a list box that reads category names from the category table. I want to select a category name and populate the product list box with the names of products in the category.

I have the code to populate the category listbox and the sql to populate the product listbox, but i'm not sure how to put them together (I guess calling a seperate php file and then passing the values back somehow using a form?

Code: [Select]<p>Select the product category:<br />
<select name="prodcategory" onchange="javascript: form.action='reportmanual_getcategoryproducts.php';">


View 1 Replies

Selection From A List Box.

php and have to implement this functionality to
select a user from a list box. I have written the code for this, but
the problem is after selecting a name and doing the required task, it
again selects the first entry in the list box. So if there are 100
users, the 100th one has to scroll down again and again.

I need to modify this code so that until the session expires, if a
person has selected his name once, that name will be selected in the
listbox until he changes it.

<select name="name" style="width: 120px;">
$query = sprintf("select * from person order by person_name");
$result = mysql_query($query);
$i = 0;
while($row = mysql_fetch_array($result))

View 2 Replies

Getting Id From A Selection List?

I have a parent table and a child table linked with an Id. The child table has two fields - ch_id and item. The parent table has a field which stores the value of ch_id for that row. I have set up a php script to generate a selection list in an html page.

The selection list only displays the text values of 'item'. Following a Submit the $_POST value will contain the text of the selected item. However, I want to store the ch_id value corresponding.A couple of ways that I can see, that I do not like, are - display the ch_id and the item text in the selection list and strip the id out before storing. This looks messy on the form; or do a reverse mySQL selection before updating the parent table.

Is there a smarter way to achieve this? In MS Access the list box can contain both fields with the id not displaying but being linked to the parent field.

View 4 Replies

Selection Of Records In List

I was wondering how to query MySQL to display only a selection (1-20,
21-40) of a query in an HTML list. Can that be done in an SQL
statement, or do you have to use PHP to dissect the returned array
with for n elements to n+20 elements. How does Google achieve the
returning of results in its search engine. I imagine that the same
query may not necessarily be executed each page listing. I am
wondering whether the results from the query would return an array of
say 36000 elements.

View 1 Replies

Multiple List Selection

I am still learning PHP, which is the best language for database driven sites. I am using Dreamweaver CS3 with the devleopers toolbox which is "ok" to help take the guess work out of things.

I am using a simple registration form that i made with the toolbox, but when I come to a multiple list to choose from (populated from the database) it doesn't work correctly. Of course, out of the multiple items selected only the last one gets inserted. From what I have read, the selection must be turned into an array then looped for this to work. Is this correct? Next how would I code this to work right.

View 1 Replies

Getting The Selection Box To List The Results Alphabetically?

Below is a snippet of my code. How do I go about getting the selection box to list the results alphabetically? I'm a newbie, so the more specific - the better.

<select name="city">

$sql="select * from city";
<option value="<? echo $row['id'];?>"><? echo $row['city'];?></option>

View 1 Replies

Using Smarty To Generate Selection List

does anyone know how to use smarty to generate a selection list without
PHP assigning a array?

eg. a list for selection minutes, but without php to assign a 1~60
array into smarty.

View 5 Replies

Generated List - Date Selection?

I have created a page that shows a list of events and a drop down box to select which data I want to show.The event list shows

Event Type
Event Name
Event Organiser
and two columns for remove and edit

The page works fine to show all entries in the database, but now I want to use the drop down select box to show data according to date and the following options

Full List, Past Events and future events

I could create 3 separate pages to get the results I want, but want to list them from this page.

I use this database coding for the full list

$query_rsEventDates = "SELECT * FROM growl_eventall ORDER BY eventDate ASC";

And I know that to select the past dates or previous dates I need to add 'WHERE eventDate > Now()' or 'WHERE eventDate < Now()'

I just need to know how to adapt what I have to use the list

View 3 Replies

Multi Selection List Code?

I want to try and find out where I am going wrong with my multi selection form field.I have a multi selection form field which allows the users to choose more than one selection from the list. Once the form is submitted I want to have each selection show up in the field I have setup in mysql table.At the moment it only enters one of the selected options.

How do i make it enter all of the selection, I have pasted my full php and html code below.

PHP Code:


// let's initialize vars to be printed to page in the HTML section so our script does not return errors
// they must be initialized in some server environments
$errorMsg = "";[code]....

View 3 Replies

Identifying User's Pick From Selection List

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

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

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

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

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

View 5 Replies

Retrieve Selection / List Option Values?

I have a dynamic build selection list. The selection list holds "Permit" strings what the user adds to a selection list before recording the form data.

I would like to save all the values of the select box to a string, selected or not selected. Can someone pl explain how would I proceed iterating through the selection box and appending to a string all option values of the dynamicly created selection?

function PermitAdd() {
var formObject = document.frmJob
if (formObject.TxtPermitNr.value!="" && formObject.TxtPermitNr.value!="") {


View 2 Replies

Redisplay List Menu Selection On Error?

i have a form with list menus where students select their course and grades. and then submit them.maybe when the user selects more than one subject at a time, please how do i go about it to redisplay item the user selected

I generated the select menu with php, below is the code

PHP Code:

// this is the array for the subject select menu items.//
$ssce = array("Subject" => "",[code]....

how to redisplay the items on the form encountering an error?

View 3 Replies

3 Drop Down List - OnChange Based On Selection?

i got 3 drop down list: name, gender and age.upon selecting any one of them, it will change the value of the other 2 according. for example, if i select gender as male, i want to show all male names and all age who belong to a male user. im able to do it with 2 drop down list using ajax but havin difficult with 3 drop down list. here is my code for 2 drop down list:


PHP Code:

$query = "SELECT DISTINCT gender FROM user";
$result = mysql_query($query);[code].....

View 2 Replies

Populating Second Drop Down List Box Based On The Selection Of The First?

i m trying to create two drop down list boxes where the second drop downl list box is populated based on the selection of the first one.I have searching the net for days and even the scripts i downloaded don't seem to be working.

View 7 Replies

JQuery List That Saves User Selection (like A Cart)?

I'm working on a travel website. I'm looking for a function that allows my users to click a hotel and save their selection to a "list" on the sidebar. I want it to function like a cart so that the list never erases and so that you can see the selection until you are ready to print everything out.

View 3 Replies

Create Dynamic Selection List For Class Registration?

I need some assistance with creating a dynamic selection list for class registration. Here is what I've go going: Case Use: Potential class takers fill out a form with contact information for a class. For the class selection there is a dropdown list containing the available classes. If the current date is past the first day of class then that class is not in the list. When a selection has been made the page will update and remaining seats available. If the class is full we are allowing two people to be put on a waiting list so the user will be given a check box to opt in or out. When the two standby seats are filled the option is no longer available.

Status: Currently every item mentioned in the case is working; however, I would like for any class that is full (including standby) to be omitted form the list along with classes that have already started.

Tables: courses - List of courses and dates offered (primary key: cid). registered - List of people register (primary key: rid, foreign key: cid).


View 7 Replies

Layout For A Selection List - Get Echo All The Items In The Category?

I have a mysql table, which has an id, an a category name.My product table has its information, and a category id.

Now my problem, when I am editing a product, I want the category to be selected. How do I get php to echo all the items in the category, but get it to also add the selected attribute to the item which is selected in the products database

View 1 Replies

Copyrights 2005-15, All rights reserved