Html - Get Two Dropdown Menus To Submit To A Dynamic Page?

May 22, 2011

I have a php page that reads data of a particular month/date to a page. But to select the month/date i have 2 dropdown menus as follow.. how do i then load send the month/year values to the page? get/post doesn't matter. Just dk how to 'submit' to that said page.

function select_dates(){
$html = "Select month: ";
$html .= [code].....


Implement Dynamic Dropdown Menus?

May 13, 2010

This is what I want my site to do:

1. User fills in some drop down menus

2. User clicks "Update Button"

3. Old Drop downs are disabled (but still visible), and new drop downs appear below with options based on the first drop down menus (in a way that i specify)

4. Repeat 1-3 a few times

5. User submits Data

My starting point I have been using is a page that sends POST data to itself, each drop down selection is saved into a var(ie. $A1 = $_POST[A_First]) and the new drop downs are populated with these vars (using a function i made). The page works nicely without disabling the Previous menus, but once i try to do that i run into problems (since disabled tables cannot be accessed via $_POST)

Again, right now I have the menus, and the update button creating new menus, but it is only good if a user goes through the natural flow, If changes are made then errors can occur. I am looking for a way to stop a user from breaking the flow by disabling the previous menus.

View 2 Replies View Related

Html - Creating A Dynamic Dropdown Field?

Jan 4, 2011

I want creat a dropdown text field when dneeded by clicking on a button in php or html.

View 3 Replies View Related

Html Form Submit - Script Generated Dropdown Values Not Sent

May 1, 2009

I have a form embedded in a html/smarty template code. Inside a form there is a dropdown box with options populated from db. If you change an option, it calls a php script via onChange event using ajax that creates/populates 2 further dropdowns. This part works fine, but if you submit the whole form (involving original dropdown and the 2 further dynamically created ones) in case of 2 dynamically created drop-downs the key-value pairs are simply not sent to the browser despite that they are inside the tags as well.In other words it sends only the values contained the template itself and not the ones generated into "txtHint1" via ajax.

html/template form:

<table border="0" width="600">
<form name='form1' id='form1' method='get' action=''>
<td width="80"><h4><b>Source 1:</b></h4></td>

part of php code called via ajax:

echo "<select name='datet_selection" . $fieldID . "'>Test</option>";
foreach ($x->sql->record as $temp) {
echo "<option value='" . $temp['datet'] . "'>" . $temp['datet'] . "</option>";
echo "</select>";

View 2 Replies View Related

Dropdown Menus

Jul 16, 2005

i would like a Dropdown menu ordered by the parent cat and then showing its sub cats like below:

<option value=0>Cat Name</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=0>Cat Name</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>

View 2 Replies View Related

Dropdown Menus Problem

Nov 12, 2005

I have two drop down menus in my php script. The items displayed in the second is dependent on which item is choosen from the first i.e. the choosen item from the first filters the items in the second Code:

View 4 Replies View Related

Checkboxes And Dropdown Menus Sent?

Jul 4, 2011

I'm working on an order form that has check boxes and drop down lists. Below is the html form.

HTML Code:
<form method="post" action="post.php">
<input type="checkbox" name="order[]" value="Item One" />
<select name="qty[]">
<option value="" selected="selected">Qty</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>


I need the selections to be echoed out on the next page kinda like this

Qty Item
2 Item One
4 Item Two

I can get them to echo out separately, but don't know how to do them together.

View 2 Replies View Related

Retrieve Value From 3 Dropdown Menus Which Are The Same Name

Mar 21, 2011

I have 3 dropdown menus which have the same name <select name="dropdown">, how to get the value from 3 of them by using php for loop and array? I did try to put array on them before, but seem it can't work. My codes :

for ( $counter = 1; $counter <= 3; $counter ++) {
if (isset($_POST['submit'])) { //Form has been submitted.
$dropvalue = $_POST['dropdown[$counter]'];
echo $dropvalue;


It gives error message Parse error: parse error in C:wampwwwplekz st8.php on line 23 I guess the error is because of $_POST['dropdown[$counter]']; I cannot put the two symbols [] inside $_POST[' '] right? How to call the array if cannot put the two symbols?

View 3 Replies View Related

Creating Dynamic Page Based On Dropdown Selection?

Jun 8, 2005

I'm using Dreamweaver, but I believe this is a general PHP/MySQL question. I have a table, with 4 fields: id, year, car_make, car_model. The data looks like this:

1 1992 Honda Civic
2 1994 Ford Probe GT
3 1999 Audi S4
4 2002 Porsche 959

On my web page, I have a drop down list that's propogated automatically with the "car_model" field entries which are pulled from that table. So when I click the down arrow, I see Civic, Probe GT, S4 and 959. Code:

View 2 Replies View Related

Add Data To A Database Using Dropdown Menus?

Mar 5, 2007

lets say i had a database with a table called admin hacks and another table called user hacks,and both tables had feilds called name and id

now what i want to be able to do is create a submit form with a drop down menu saying the table names mentiond above, also the form will have a field called name.

now lets say a user slected admin hacks from the drop down menu and enterd jack in the name, how would i get the data in that submitted form to be inserted into the correct database table, so jack should now be in the table called admin hacks

also lets say someone selected user hacks and entered jon how would i do the same for that?

View 1 Replies View Related

Submit The Data In The Dropdown Box To The Action Page To Search The Sql Database For The Term?

Nov 13, 2009

i am trying to make a page that able to search the data that store in the sql database, i would like to have a field search which enable the user to choose the field they wan to search. how to submit the data in the dropdown box to the action page to search the sql database for the term. here is my search page:

<title>My Simple Search Form</title>


View 9 Replies View Related

Thousands Of Items In Multiple Dropdown Menus?

May 19, 2011

A client has given me a task to do that I've not done before, and so I'm looking for the best way to do it. They have a form they want users to fill in, but for one field, they want an option of thousands to be placed into three dropdown menus.

For example: So a user will only be able to choose a Venue once they've chosen a City, only a City once they'd chosen a State. (A nice way to break up the thousands of options.) I suppose I could this quite easily using POSTBACKs and a simple database, but I imagine that doing something with AJAX and a simple database would be the slicker solution.

Are there any other ways that this problem might be tackled? If not, does anyone have any links to tutorials or code snippets I could grab? Secondly, how long do you think it would take you to implement such a system? I've never done this before so I'm hoping to avoid as many unforeseen pitfalls as possible.

View 5 Replies View Related

Forms - Collecting Data From Different Dropdown Menus?

May 28, 2011

in my html form I have 3 dropdown menus for date of birth, day menu, month menu and year menu.

I want to collect day value from day menu, month value from month menu, year from year menu.

in php file I wrote for collecting the date of birth data; but it didn't work.

$date = $_POST['day'] . "-" . $_POST['month'] . "-" . $_POST['year'];

View 2 Replies View Related

Dynamic Dropdown And Hardcode Dropdown In Select Form

Dec 4, 2002

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 2 Replies View Related

Make Dynamic Dropdown Selected After Posting That Dropdown?

May 1, 2010

t's probably easier than I think but I can't think anymore.I've got a drop that shows all the companies and when you choose a company the page refreshes and that company you selected is now selected. The reason I do this so I can populate a second dropdown or some other input fields. The code below is just to show what I already do no problem and is just and example to get to my real problem.PHP Code:



View 2 Replies View Related

Dynamic Drop-down Menus

Mar 7, 2003

I am developing an on-line booking system, and am designing a script which creates a booking "area". An area has the following fields:

Area Name
Day start time (the time of day bookings can begin e.g 9 AM)
Booking Time Slot (the length of time for each time slot e.g 30 mins)
Day Finish Time (the time of day bookings must finish e.g 6 PM)

What i require is a method for locking down the users input so that the finish time is a list that is created that is divisable by the number of minutes used for a booking time slot . e.g. if the start time is 9 am and each booking time slot is 30 minutes, then the user must select a finish time which is divisable by 30 i.e. either on the hour or half past.

I have looked at several methods for doing this but cannot decide what would be suitable.
Ideally I want the user to be able to select the start time from a dropdown (static html would do) the select a booking time slot (again a static html dropdown would surfice) and then a dynamic dropdown be created with a list of Day Finish Times.

My questions are these:

Is this the right way to go about doing this - are drop downs my best option? If so, is calculating the day end time list the best way to go? Would javascript be more suitable, rather than a php form?

View 5 Replies View Related

Dynamic Pull Down Menus

May 29, 2007

I was wondering if a kind person off here could point me in the right direction.

I'm making a form on my website so users can request certain information, the thing is, the information they will be requesting will contained in pull down menus, with all the data for the pull down menus in a database. How would i go about changing one set of pull down menus depending on what is selected in a previous menu?

For example, say a user selects "Honda", the next menu would contain all the Honda models in our database, if the user selects something else, they're given more choice again.

View 1 Replies View Related

Dynamic Menus And Blob Problems

Jul 16, 2005

I have a database table with three fields, id, caption and data. I
have used the id and caption to create a dynamic menu. it just throws
it into a loop with extra html formatting stuff. No problem.

The data field is a large blob. The data is a complete html file which
comes out of a timing system for race cars, its basically a big table.

How do I render the blob data within the current window or in a new
window when the link is clicked, its got me stumped. I have used php
to bring the page together using include statements, header footer and
side_nav. the menu gets produced in side_nav.

View 1 Replies View Related

Dynamic Jump Menus Several Select Fields?

Feb 6, 2011

I have a search or browse form for selecting and displaying country, state and category. In other words a form with 3 select fileds.It's getting the results from a database.It works with a standard form and submit button.

I'm looking for a "JUMP MENU" solution, so that when you select each select field it jumps/submits and the two other fields displays the new results from that. So if the start country was USA and I wanted to select CANADA, the states in the state select field would change the Canada regions without having to submit a submit button..........etc Also the same thing with the CATEGORY select field.

Below is the form I currently have that just uses a form and a submit button. how to change this into a jump menu solution instead.

<form method="GET" action="browse.php">

View 3 Replies View Related

Form: Checkbox Value After Failed Submit: Dropdown Value Without Submit

Jul 13, 2009

I'm developing an events calendar for an arts website and one of the options is to add an event. When a user adds an event they put in the start date, the end date, the start time and the end time using drop down menus. This works fine. However, if a user wants to add more than one date I have a problem. I used a dropdown menu to select how many more date the user wants to add. Like this:


This works fine to an extent. Since the drop down menu to choose how many more dates the user wants to add is not the first in the form, when the user chooses, it reloads the whole page erasing everything that was typed in the form before it. I use isset to prevent this from happening but that only works when the user presses submit and there's an error. I have seen forms on the internet that check values of the form as they are put in without reloading the page and I was hoping to do that for this field but I can't find any tutorial or help on the internet or even in the books. The last result would be to put fields for all additional dates in the form without letting the user choose how many they want to add which would make my big form even bigger but I was wondering if someone knew of a better way?

Also, I have a problem with keeping checkboxes that were checked before the user submits a form, still be checked after a user hits submit but there is an error or something and the user is shown the form again. My checkboxes look like this:


View 4 Replies View Related

Show Selected Value For Drop-downs In Dynamic Menus

Oct 8, 2007

I frequently work with forms where menus are pulled from a database. When a user enters data in the form and then saves it, if it is retrieved later, the form shows the saved data, including the drop-down menus.

The way I normally do this in php is to first retrieve the data for the saved from. Then I create the menus and within the loop of creating the menus I simply add the word "selected" into the results row which equals the saved option on the form. Code:

View 3 Replies View Related

Getting The Dynamic Data From <select> Menus To Write Into My MYSQL Database?

Aug 11, 2010

I'm having trouble getting the dynamic data from my <select> menus to write into my MYSQL database. Can anyone s what I'm doing wrong here? First post btw The output looks like this, which is obviously wrong:

Code: [Select]<html>
<head> </head>
<link rel="stylesheet" type="text/css" href="./css/newuser.css" />

View 5 Replies View Related

Weird ( On A Page Containing HTML Form Submit )?

Sep 2, 2010

I am fairly new to PHP, and I recently changed my whole site to use PHP sessions, which worked fine. Then I added PHP parts in my pages that display different menu choices depending on if a PHP session exists. This also works fine, until I found that any HTML/PHP pages that have form/submits no longer work, and I get kicked back to the index.php

After slow backtracking, I removed new parts, and found the forms started working again if I removed the PHP part that chooses which JavaScript file to reference, as follows from contact.php


I tried also to find a workaround, but it would mean having PHP inside my JavaScript file, but I am not sure it would work, since JS is client side, and PHP server... Essentially, I just want to run certain JS menus depending if the person is logged in or not.

View 13 Replies View Related

Convert Dynamic PHP Page To HTML?

May 25, 2006

I've got a PHP page on which I do mathematical calculations. I.e. there are a couple of input boxes and a button, that onClick calls a Javascript routine and outputs the results of the calculation in some other text boxes.

What I want to do now is to be able to firstly print the results by calling javascriptrint(), and also to save the page with the results and also email the page to a friend.

The easiest way would be if the page was a static HTML page. Then printing, saving and attaching it to an email are easy. So ideally, on the PHP page, I would click a button, that would pop up an HTML page, with the results of the PHP page. And then on that page I would have the option of saving as, printing or emailing.

View 1 Replies View Related

Create An Pdf For A Dynamic Html Page?

Mar 17, 2011

I want to generate a pdf file dynamically, based on the html page....Means,Html page is generated from the user submitting the details, based on the details, dynamically i generated one html file contains 3 images, now i want this final html page as pdf format..I tried some tools by giving the URL of that page, but it is generating only the text part, but not the images... and also i have submit buttons in that html page, i don't want that in the generated pdf...

View 5 Replies View Related

Create A Html Index Page That A Submit Form?

Jun 16, 2009

I a newbie on using the phpmailer. Correct me if i wrong.I create a html index page that a submit form. When i fill up the detail on the form press send it will send mail to my email account using phpmailer function.Question why i cant recieve the email after i press send.I have four file put into EasyPHP. index.php , send.php , class.phpmailer and class.stmp.php

View 2 Replies View Related

Dynamic Page HTML Code Question

Jul 20, 2004

I'm gonna have all my pages load up a dynamic header and footer, depending on what variable I call up.

So at the beginning of my code it will call for a banner, this banner will be set as a variable in a seperate page that i'll call up.

Now i'm wondering, can the page I call up (with a list of variables) have HTML code in it, like this:

View 1 Replies View Related

Make Static Html Page From Dynamic B2b Cms?

Aug 13, 2009

I am trying to make static html page from dynamic b2b cms for SEO, I wrote the following script for create Html files of products list of each user:

// Start Company Name
$result=mysql_query("SELECT es_company_name FROM db_profile where es_uid=$userid",$db);

View 4 Replies View Related

Html - Call Form Submit Action From Function On Same Page?

May 19, 2011

I'm working on a simple web application. In order to reduce the number of files, I want to put (php) code for a form submit function into the same page as the form. Something like this:

<form id = "rsvp-status-form" action = "rsvpsubmit" method = "post">
<input type="radio" name="rsvp-radio" value="yes"/> Yes<br/>
<input type="radio" name="ravp-radio" value="no" checked/> No<br/>


What is the proper way to call the submit function?

View 2 Replies View Related

Javascript - Load Dropdown According To The Value Of Another Dropdown - Without Refreshing The Page?

Apr 24, 2009

I have created a page in PHP, in that i need to load a dropdown2 corresponding to the value of dropdown1 without refreshing the page. The values for those dropdown's are from the database. I dont want to refresh the page for every click,

View 1 Replies View Related

Make And Submit A Form Using Jquery/javascript Only Using `.html` Extension For Page?

Feb 20, 2011

Is it necessary to change the extension of page from .html to .php or .aspx to make a working form?I'm making a single page website. I need to make a form on the page with 3 or 4 field. and the data of form should go to an email address which I will define.Is it possible to make and submit a form using jquery/javascript only with .html page.?or if it's not possible can I iframe a php form in .html page, will it work?

View 3 Replies View Related

JQuery Ajax Form Submit Returns Html Of The Index Page?

Mar 10, 2010

Have an HTML form that I am submitting using JQUERY ajax instead of updating with a server response, it is updating with the index page html.

The form

<form id="publishimages" action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<input type="submit" name="publishimages" value="Publish Selected" />
if(isset($_POST['publish'])&&$_POST['publish']=="Publish Images"){


View 2 Replies View Related

Include .html Pages And Marked Menus?

Jan 13, 2010

Using this code to change the pages with links in menu:



Code:[Select]<a href="index.php?str=page_2">Page2</a>.Now what code i need to add or change to get things on menus marked on which page are you atm?Page1, Page2, Page3.

View 12 Replies View Related

Populate Dropdown W/o Submit

Jun 8, 2007

Ive got some arrays; one array is most of the U.S states. the other arrays are names of clinics my company has within the selected state. I want to be able to select a state from a drop down and have another drop down next to it that will populate itself automatically.... without having to press a submit button.

View 4 Replies View Related

Dynamic Dropdown?

Aug 22, 2000

I am posting a code for dynamic dropdown by Leon Atkinson, it works fine but i have a doubt: I tried to add another functionality to it where i got stuck! Once the city also gets selected from the second drop down i wanted that on clicking the submit button it should go to some html page wrt to the city choice. Code:

View 4 Replies View Related

Dynamic Dropdown Box

Jul 17, 2005

im looking to have two drop down boxs one with makes of car and
the second drop down box to automatically populate with all the model
of that particular make of car. there are about 50 makes and upto 50
models per make.

I just would like to know the best way to do this - javascript or use
a database? it would be a lot of code todo it in javascript wouldnt

View 8 Replies View Related

Dynamic Dropdown

Jan 19, 2006

This may be rudimentary but I'm just trying to get my head around this without having to write a billion lines of extraneous code. I have a dropdown selection list, populated from a mySQL database, containing times in a HH:MM:SS format. The times are 30 minutes interval spanning an entire day, as in 01:00:00, 01:30:00, 02:00:00 all the way to 24:00. I have it entering fine into the database, but when I want to edit this time, I'd like to have the value in the database be marked as the CHECKED value on the dropdown so I don't have to manually re-enter the time for every edit.

View 1 Replies View Related

Dropdown Menu Without Submit Button

Mar 30, 2001

How do I get a dropdown menu to submit with the selection of an option rather than pushing the submit button.?

View 2 Replies View Related

Filter By Dropdown Without Submit Button

Apr 7, 2011

ive got the code below set up. but how do i filter the result without submit button and filtering the result based on dropdown value (id for user)?

form method="post" name="report_filter" action="<?= $_SERVER['PHP_SELF'];?>" >
select name="name" onchange="report_filter.submit();">
<option value="--">Filter by:</option>
<option value="1">Andi</option>
<option value="2">Katy</option>

View 1 Replies View Related

Dropdown Sticky And Submit Form

Jan 18, 2010

I have this drop down populated by a Mysql DB. On change of the drop down the whole page populates information from a the DB. Well what I want when I submit this form (there are two forms on this page) I want it to return to the same client that I just had selected in the drop down. Right now I'm using a session to bring it back and select that same client as before but the on change event is not kicking in and selecting the information out of my data base for the person selected.

$current = isset($_SESSION['ClientNamefour']) ? $_SESSION['ClientNamefour'] : 0;
while ($row = mysql_fetch_array($result)) {
$value="$id, $thing";..........

View 2 Replies View Related

Dynamic Dropdown Menu

Sep 22, 2005

with help from the PHP Gurus here, I have a dynamic menu script:

PHP Code:

$time = time() + 28800;
$time_plus2 = strtotime('+ 6 days');

echo '<select name="select">'
while ($time <= $time_plus2)
    echo '<option value=>' . date('l, F d', $time) . '</option>'
    $time = strtotime(date('Y-m-d', $time) . ' + 1 day');
echo '</select>'

how do I now get the days of the week to link to different pages?

View 2 Replies View Related

Dynamic Content Using Dropdown

Oct 29, 2005

I have the following dropdown menu which is populated by content or categories (with catID being the category ID) from the database. What I want to do though is when an item in the drop down list is selected, I want to show dynamic content under it. BTW, I must not emphasize on "dynamic" too much because it may seem like a DHTML thing going on here. For example, if a user selects a certain item/category in the list, I want content such as coupons in the DB which have the same catID as the category selected showing up.

The coupons are discreetly placed in the DB table "coupons" with the category ID being catID and...for eg:

catID --- couponname --- couponinfo --- expiredate

If you are going to include any kind of javascript, please write them as well. Here is the code I am starting off with:

<form name="myform">
<select name="selectID" size=10 > <? $resultcat = mysql_query("SELECT * FROM Category");

while ($myrow2 = mysql_fetch_array($resultcat)) {?><?printf("<option value=%s>%s</option>", $myrow2["catID"],$myrow2["name"]); } ?></select></form>

View 1 Replies View Related

Three Dynamic Dropdown Boxes

Feb 10, 2006

Can any one help me in dynamic drop down creating? I have three dropdowns One for Country one for state and one for location. My plan is to select the country from dropdown according to this i have load the values in state drop down from MySql table. Depending on the state i have to select the location too.

View 1 Replies View Related

Script Dynamic Dropdown?

Jan 6, 2011

ive got 2 dropdown menu that retrieve the file from the database. but it gives me an error when im trying to get the the 2nd file. The first dropdown, successfully retrieved but the second one gives me an error?

in PHP class

class treatment{
function __construct($mysqli){}
// Get treatment list
function get_t_dermal_filler(){.............

in webpage

$treatment = new treatment($mysqli);
<?= $treatment->get_t_dermal_filler();?>
<?= $treatment->get_t_wrinkle_rel();?>

the error

<b>Warning</b>: mysqli::query() [<a href='mysqli.query'>mysqli.query</a>]: Couldn't fetch mysqli in <b>

View 1 Replies View Related

Generate Dynamic Dropdown?

Oct 20, 2010

I am using PHP to generate dynamic dropdown, the dropdown list items are fetched from database.

Here's the php code for that and it works.

<select name="title[]" id="title">
<?php $categories = Category::find_by_cid(5); foreach($categories as $category): ?>
<option value="<?php echo $category->name; ?>"><?php echo $category->name; ?></option>
<?php endforeach; ?>

What i want to do is, Using jQuery whenever a link with id AddNew is clicked, a new dropdown should appear below that, containing same values. Also, is there any way to execute php code inside javascript?

ex :

var name = "<?php echo $user->name; ?>";

View 3 Replies View Related