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].....

View 1 Replies


Implement Dynamic Dropdown Menus?

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

Html - Creating A Dynamic Dropdown Field?

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

View 3 Replies

Html Form Submit - Script Generated Dropdown Values Not Sent

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

Dropdown Menus

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

Dropdown Menus Problem

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

Checkboxes And Dropdown Menus Sent?

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

Retrieve Value From 3 Dropdown Menus Which Are The Same Name

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

Creating Dynamic Page Based On Dropdown Selection?

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

Add Data To A Database Using Dropdown Menus?

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

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

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

Thousands Of Items In Multiple Dropdown Menus?

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

Forms - Collecting Data From Different Dropdown Menus?

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

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

Make Dynamic Dropdown Selected After Posting That Dropdown?

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:

$usercompanydropdown = "";
if ((isset($_POST['usercompany']))&&(!empty($_POST['usercompany']))) {
$usercompanydropdown = (safe($_POST['usercompany']));


View 2 Replies

Dynamic Drop-down Menus

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

Dynamic Pull Down Menus

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

Dynamic Menus And Blob Problems

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

Dynamic Jump Menus Several Select Fields?

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

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

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

Show Selected Value For Drop-downs In Dynamic Menus

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

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

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

Weird ( On A Page Containing HTML Form Submit )?

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

Convert Dynamic PHP Page To HTML?

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

Create An Pdf For A Dynamic Html Page?

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

Create A Html Index Page That A Submit Form?

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

Copyrights 2005-15, All rights reserved