Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions dynamic select box
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


bolagani venkatarao
dynamic select box
0 Answer(s)      2 years and 6 months ago
Posted in : JavaScript Questions


thank u my dear friend.but i have a code like this will u plz edit and send to me in correct manner. i am waiting for it .if city selected then based on city locations have to come from database.if u send as much as possible it will helpful to me my dear friend thanks forever.

<html>
<head>
<title>demo</title>
<body>
<form method="POST" action="http://localhost/vtigercrm/modules/Webforms/
post.php">
 <input type="hidden" value="Leads" name="moduleName" />
 <table>
  <tbody>
   <tr>
      <td><label>Last Name</label></td>
      <td><input type="text" name="lastname" value="" /></td>
   </tr>
   <tr>
      <td><label>First Name</label></td>
      <td><input type="text" name="firstname" value="" /></td>
   </tr>
   <tr>
      <td><label>Company</label></td>
      <td><input type="text" name="company" value="" /></td>
   </tr>
   <tr>
      <td><label>email</label></td>
      <td><input type="text" name="email" value="" /></td>
   </tr>
   <tr><td><label>city</label></td><td colspan=1>
       <select name="city">
        <option>city</option>
<?php
$connect=mysql_connect("localhost","root","venkataz");
if(!$connect) die("access failed");
$select=mysql_select_db("vtigercrm530");
if(!$select) die("select failed");
echo "selected vtigercrm530";
$query="SELECT DISTINCT address_city FROM vtiger_users";
$result=mysql_query($query);
if(!$result) die("database access failed:" . mysql_error());
while($row = mysql_fetch_array($result))
{
  echo "<option value>".$row['address_city']."</option>";
}
?>
</select>
</tr>
<tr><td><label>lane</label></td><td colspan=1>
<select id="lane" onselect="show();">
<option>location</option>
<script type="text/javascript">
function show()
{
var lane=document.getElementById["lane"].selectedIndex;
alert(lane);
}
</script>
<?php
$connect1=mysql_connect("localhost","root","venkataz");
if(!$connect1) die("access failed");
$select1=mysql_select_db("vtigercrm530");
if(!$select1) die("select failed");
echo "";
echo "<br/>";
$query1="SELECT address_city FROM vtiger_users";
$result1=mysql_query($query1);
if(!$result1) die("database access failed:" . mysql_error());
$lcity=$_REQUEST["city"];
$rows=mysql_num_rows($result1);
for($j=0;$j<$rows;$j++)
if(mysql_result($result1,$j,"address_city")==$lcity)
{
 $query2="SELECT address_street FROM vtiger_users WHERE address_city='".mysql_result($result1,$j,'address_city')."'";
$result2=mysql_query($query2);
while($row= mysql_fetch_array($result2))
 {
echo "<option value>".$row['address_street']."</option>";
 }
}
?>
</select>
</td></tr>
  </tbody>
 <table>
 <input type="submit" value="Submit" />
</form>
</body>
</head>
</html>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Dynamic select box - Ajax
Dynamic select box  Hi, I Have almost completed the task... in the other select box automatically.. The city details must be extracted from... select boxes in my page.. One is "Select a Country" and other one is "Select
dynamic select box
dynamic select box  hello friends i created a form and details of city & locations have to be come from database. if city hyderabad chosen then locations of hyderabad only appear in location selectbox.plz send code it is more
Advertisements
dynamic select box
dynamic select box  thank u my dear friend.but i have a code like...> <select name="city"> <option>city</option>...) die("access failed"); $select=mysql_select_db("vtigercrm530"); if(!$select
select box and text box validations
select box and text box validations  hi, any one please tell me how to set validations for select box and text boxes using bean classes? thank you   Please visit the following link: http://www.roseindia.net/jsp/user
Dynamic check box problem
Dynamic check box problem  In my project i have used a dynamic table, in the each row of that table there is one check box [that i have created dynamically]. Now my problem is that i can't access those values from that dynamic
Select Box question
Select Box question   hello guys, i want to display data in a select box using foreign key,those data will come from other table which which is parent, that form will be in HTML(web ). i use oracle as database and i want using
Multiple select box
Multiple select box  Hi, I need help in code for multiple select box. The multiple select box should be populated with the db values.The selection done in the multiple select box is to be moved to the text area provided a add
Drag a Text Box into dynamic positions
Drag a Text Box into dynamic positions  Plz can anyone tell how can i drag a text box using mouse or arrow keys... Im doing a accounts projects and i need this feature for cheque configuration
JavaScript Dynamic Combo Box
JavaScript Dynamic Combo Box Here we are going to create dynamic combo box... in respective arrays. As the user selects a country from the first combo box, the cities...(); arr[0] = new Array("-select-"); arr[1] = new Array("
java-select dynamic files. - Java Beginners
java-select dynamic files.  My java program is processed files. Now i have set inputfile is default location. i want to change input file location in run time. How to insert new files in run time. I need to take system file
dynamic drop down list box - Java Beginners
dynamic drop down list box  hi all , I want to dynamically populate a drop down box from an sql query in a servlet program, using only html... Rajanikant  Hi friend, dynamic bombobox in servlet
Select Box Validation in JavaScript
Select Box Validation in JavaScript In this section we will discuss about select box validation in JavaScript. Select box allows you to create drop down list... options. HTML select Box having same functionality as HTML Checkbox Fields
how to operate on select box using ajax in struts2?
how to operate on select box using ajax in struts2?  I am doing a project on struts2 in which i have a jsp page which has two select boxes like Now i want to use ajax so that when i select a district value
how to operate on select box using ajax in struts2?
how to operate on select box using ajax in struts2?  I am doing a project on struts2 in which i have a jsp page which has two select boxes like <... it by assigning to the block list select box. so please help me..its urgent
display from select box - JSP-Servlet
display from select box  I am doing a jsp project. In this jsp project i have to show the photos in one cell depending on the selection from other selection box which is in the same page. The photos are stored
Dynamic loading of Combo box list using servlet - JSP-Servlet
Dynamic loading of Combo box list using servlet  I have the category... database dynamically, when I select the category? Plz help me.  Hi friend I give theortical descrption read it! Select a value from drop dwon box
dynamic generation of html:select tag from textbox value
dynamic generation of html:select tag from textbox value  Hi, I am a newbie to java and struts. In my application, I have a requirement like when i give some input in a textbox and click on a add link. It should be added
dynamic generation of html:select tag from textbox value
dynamic generation of html:select tag from textbox value  Hi, I am a newbie to java and struts. In my application, I have a requirement like when i give some input in a textbox and click on a add link. It should be added
how to display(update) current date and month in select box on selecting the year.
how to display(update) current date and month in select box on selecting the year.  how to display(update) current date and month in select box on selecting the year
Insert value of dynamic generated text box in jsp using javascript
Insert value of dynamic generated text box in jsp using javascript  hello sir , i want to generate dynamic text box at run time and i did that using... that dynamically generated text box value into database at a time without
How to implement ajax in struts2 to operate on select box in jsp
How to implement ajax in struts2 to operate on select box in jsp  I am doing a project on struts2 in which i have a jsp page which has 2 select boxes... by assigning to block list select box... plz help me .. its urgent .. thanx in advance
Use of Select Box to show the data from database
Use of Select Box to show the data from database       Example program using Select Box to show retrieved data from database This example will describe you the use of Select Box in a JSP
How to write a select box and id should be stored in database?
How to write a select box and id should be stored in database?  Hi, How to write a select box and select the name(devi) regarding name id(like 60...); JLabel lab=new JLabel("Select Name:"); final JComboBox combo
Passing Multi select list box values using ajax to get values to dependent list box
Passing Multi select list box values using ajax to get values to dependent list box  Hi, I have a jsp page which has 3 dependent list boxes... the dependent values to the immediate next list box. Please help me
Not Able to select an Item in Spark Combo Box control (Adobe Flex Object) using QTP
Not Able to select an Item in Spark Combo Box control (Adobe Flex Object) using... Flex controls. But i am not able to select any item from Spark Combo Box. I tied using .Open (Its not opening the drop down list) , also i tried using Select
add text box and select list dynamically and get its value to store it into database using jsp request parameter
add text box and select list dynamically and get its value to store it into database using jsp request parameter  its very helpful when you have only... added select box also into next jsp page plz reply me as early as posssible
i want to select a multiple value of check box by using onclick or onchange event without using from submission
i want to select a multiple value of check box by using onclick or onchange event without using from submission   i have 4 check box name 1)profile... the result is ok but after getting value of first box now i want a result of second box
select one item name throug combo box than other combobox show item price
select one item name throug combo box than other combobox show item price  i have one table in database item master..if i select one item name through combo box than other combobox show item price only select item name... how i
sir plz help in design a jsp page whichis as follow username [_____] select [__>]password [_____] after selection then onlypassword text box is visible
sir plz help in design a jsp page   sir plz help in design a jsp page which is as follow username [ _ ] select [ > ] password [ _ ] after selection then only password text box is visible
jQuery 'select' form event
input box. In this Example, two input text box are given , when we select...; Click and drag the mouse to select text in the input box. </p>...jQuery 'select' form event In this tutorial, we will discuss about
DYNAMIC BINDING
DYNAMIC BINDING  WHAT IS DYNAMIC BINDING
 

 

 

DMCA.com