473,466 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

New Select box back to clear?

Chrisjc
375 Contributor
Now that I have a full version of drop downs with my database working be-side it using PHP and AJAX... I have a new question.... That question is Say a user picks first dropdown = GAS then they pick 2nd dropdown= FORD then lets say they pick everything else and they get the part number but oh wait they didnt mean to PICK FORD.... so they go back to that dropdown box and change it to GMC... but the other boxes didnt go back to ( SELECT ) only the one under it.... is it possiable to clear them all back to SELECT???

link ( www.triplesource.net/db/v5/ )

Thanks in Advanved

Chris
Nov 20 '06 #1
5 1534
ronverdonk
4,258 Recognized Expert Specialist
With Javascript you can delete dropdown entries, starting at the next one from the DIV you are going to fill. This can be done via the DOM.

Ronald :cool:
Nov 20 '06 #2
Chrisjc
375 Contributor
With Javascript you can delete dropdown entries, starting at the next one from the DIV you are going to fill. This can be done via the DOM.

Ronald :cool:

I dont fully under stand...

I also came across a new issue I sent you a E-mail about it also here is what I sent you.

Okay new problem found....

In this area of CODE
================================================== =======
Expand|Select|Wrap|Line Numbers
  1.  // ================================================================================
  2. // Get the EXPPARTNO after user selected fuel, make, model, year, engtype and liter and display EXPPARTNO
  3. // ================================================================================
  4. if(isset($_GET['getpart']) AND isset($_GET['fuel']) AND isset($_GET['make']) AND isset($_GET['year']) AND isset($_GET['model']) AND isset($_GET['engtype']) AND isset($_GET['liter'])){   
  5.   $fu = $_GET['fuel']; 
  6.   $mk = $_GET['make']; 
  7.   $yr = $_GET['year'];
  8.   $mo = $_GET['model'];
  9.   $en = $_GET['engtype'];
  10.   $lt = $_GET['liter'];
  11.   $res = mysql_query("SELECT exppartno, expldescr, dciptdescr FROM Catalog WHERE fuel='$fu' AND year='$yr' AND make='$mk' AND model='$mo' AND engtype='$en' AND liter='$lt' GROUP BY exppartno, expldescr, dciptdescr ORDER BY exppartno, expldescr, dciptdescr")
  12.      or die("Invalid query: " . mysql_query());
  13.   if (mysql_num_rows($res) > 0) {
  14.     while ($row = mysql_fetch_assoc($res)) {
  15.       $pn = $row['exppartno'];
  16.       $ed = $row['expldescr'];
  17.       $dc = $row['dciptdescr'];
  18.       echo "<label><b>Part number:</b></label>$pn ";
  19.       echo "<p>&nbsp;</p>";
  20.       echo "<b>Description:</b>$ed, $dc";
  21.     }
  22.   }
  23.    else {
  24.     echo '<label>Part number:</label>Not available <b>Description:</b>Not available<br />';
  25.   }
  26. ?>
================================================== =======
Yeah it pulls what it needs but.... If you pick from the following fields please... ( DIESEL) (CHEVY) (SILVERADO 2500 HD) (2001) (V8) (6.6) It will show one part number..... HOW EVER in the DATABASE there is well over 5 items... it should be showing.... and is not... Now if I take the GROUP BY and ORDER BY statment out... it will show just EXHUAST part NUMBERS with it on it shows the AIR FILTER....... Why is this???? How do I make it show all??? By the way I added another ROW in the database... in this ending statment... IT IS (DCIPTDESCR) And I was trying to get everything to be displayed on one line... and then show everything else down... so like this

PART# 54-1000 Description: Air Filter, OE etc....
PART# 54-1002 Description: Air Filter, OE etc.....
and so on whatever there is to list that matchs... and I know for this selection there shold be at least 5 or more.... I looked them up in my DB in EXEL...

Let me know what you find Thanks in advanced!
Nov 20 '06 #3
ronverdonk
4,258 Recognized Expert Specialist
Remember that your DIV6 height (in INDEX1.PHP) is defined as 30px, so it can contain only 2 lines of text!. Make it 300px and see the difference.

Ronald :cool:
Nov 20 '06 #4
Chrisjc
375 Contributor
Remember that your DIV6 height (in INDEX1.PHP) is defined as 30px, so it can contain only 2 lines of text!. Make it 300px and see the difference.

Ronald :cool:

Ahhh I c thank you thank you!!

Most helpful!!!

Okay now the biggest question I have of all... When you selecting and someone messes up... how do I get it to clear? back to SELECT??/ what is DOM???
Nov 20 '06 #5
ronverdonk
4,258 Recognized Expert Specialist
The DOM (Document Object Model) gives you generic access to most elements, their styles and attributes in a document. This is a no-nonsense, easy to follow DOM reference for JavaScript.
You can reach each part of an HTML document via the DOM, so you can also reach the DIVs that are used to be filled with the selection results.

The user doesn't mess up, it is normal user behavior to browse his options.
E.g. you have 6 DIVs to fill. When the user suddenly starts to select the content of DIV3, you supply the result in the usual way PLUS the code to clear DIVs 4, 5 and 6 (that is done via the DOM) via Ajax.

Ronald :cool:
Nov 20 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: RCS | last post by:
I've been running into more and more complexity with an application, because as time goes on - we need more and more high-level, rolled-up information. And so I've created views, and views that use...
4
by: JohnSouth104 | last post by:
Hi I want to warn the user that changing the selected item in a pull-down will clear some data he has already entered in a file download box. I've tried using confirm() to return true or false...
9
by: Kelvin | last post by:
Okay so this is baking my noodle. I want to select all the attritbutes/fields from a table but then to excluded any row in which a single attributes data has been duplicated. I.E. Here's my...
3
by: William Wisnieski | last post by:
Hello Again, I'm really stuck on this one.....so I'm going to try a different approach to this problem. I have a query by form that returns a record set in a datasheet. The user double...
2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
16
by: Brian D | last post by:
I have a multiple select list that is created dynamically based on a previous selection on an asp page. The first thing I do is to clear the curent option list by ...
1
by: jason.tadeo | last post by:
I am very new to java script and I am trying to be able to have two select boxes. One that has states and one that has cities. On the change or pick of the state then the cities in my data base are...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
22
by: Rickster66 | last post by:
As Instructed this is a new thread regarding my original post: "Select Only 10 Columns Going Back" I'm sorry for the late response. I've been gathering up information and carefully with as much...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.