473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

dynemic dropdown on two select -How do you go about creating two dropdown boxes such

Expand|Select|Wrap|Line Numbers
  1. <head><script type="text/javascript" src="http://bytes.com/script.js"></script></head> <form  name="buy" action="http://bytes.com/purchase"> <div> <center> <br/><br/><br/><br/> <table> <tr><td> <h3>Product1*</h3></td> <td><select name="pname" onchange="car(document.buy.pname.options[document.buy.pname.selectedIndex].value);"> <option value="">---brand---</option> <option value="1">Maruti</option> <option value="2">Tata</option> <option value="3">BMW</option></select></td> <td> <h3>****Modal*</h3></td> <td><select name="modal"> <option value="">---select---</option> </select> </td> </tr></table></center></div></form>
  2.  
  3.  
  4. and script.js
  5.  
  6. function car(selobj,newobj)
  7. {var t=document.purchase.modal;
  8.     t.options.length=0;
  9.     if(chosen==="")
  10.         {
  11.              t.options[t.options.length] = new Option('---select---','');
  12.         }
  13.         if(chosen==="1")
  14.             {
  15.                  t.options[t.options.length] = new
  16. Option('800','11');
  17.   t.options[t.options.length] = new
  18. Option('alto','12');
  19.             }
  20.              if(chosen==="2")
  21.             {
  22.                  t.options[t.options.length] = new
  23. Option('nano','21');
  24.   t.options[t.options.length] = new
  25. Option('nano lxi','22');
  26.             }
  27.              if(chosen==="3")
  28.             {
  29.                  t.options[t.options.length] = new
  30. Option('murcdies','31');
  31.   t.options[t.options.length] = new
  32. Option('bmw 123','32');
  33.             }
  34. }
my output is not respond........please do some help
thanks......
Jul 5 '14 #1
0 989

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

Similar topics

0
by: Erwin Radermacher | last post by:
Hello dear PHP users, I have a form with text boxes and a dropdown menu with names of cities The adjacent textbox fills by the help of a Javascript function. My question is, how to realize the...
3
by: jagg | last post by:
Hi, i save junior football results in a mysql table (FIELDS id jugend autor sptag ergebnis spdatum zeit ) With the following lines I generate a site whichs gives me ALL results Code:...
1
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list...
1
by: James | last post by:
I am creating a system whereby equipment is inspected. Data is inputted into an inspection form. However, any equipment that is not satisfactory needs to have spare parts ordered for that piece of...
6
by: BurntWithTime | last post by:
Hello everyone, Please can anyone tell me if it is possible for a VB.NET application to check a database and then create textboxes on a form that correspond to those records on the database? For...
1
by: PraveenAnekalmat | last post by:
Hi, While sending mails, if we type a character in the To field, it should list all the id's starting with that character.Now i'm making ajax call using onkeyPress. But only 1 value is...
2
by: bdbeames | last post by:
Ok, It has been one of those days. Here is my bump in the road. I have an add user form for the administrator. The administrator enters name, password and then selects access level from a...
3
by: ghjk | last post by:
I have 3 text boxes and one dropdown box. Drop down box has 2 values eg: Yes and No. Normally i want to hide last 2 twxt boxes and when user select "No" i want to set visible to the above mention...
3
by: fran7 | last post by:
Hi, I want to replace the input type="radio" with a dropdown <select>. I wonder if anyone could tell me how to adjust the javascript. I have tried replacing "checked" with "select" but it didnt work....
2
by: chinni1 | last post by:
Hii.. I Have 2 dropdowns.The first dropdown contains main products which is from database table1. If we select The one of dropdown value then the 2 second drop down should fill with all sub...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.