Share on Google+Share on Google+

bolagani venkatarao
second selectbox of dynamic
0 Answer(s)      4 years and 11 months ago
Posted in : JavaScript Questions

hello friends i hava a code like this and could any body help me with editing code and send me code. i am getting city values but i can't location values of city from database.thanks in advance.

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

Ads

View Answers









Related Tutorials/Questions & Answers:
second selectbox of dynamic
second selectbox of dynamic  hello friends i hava a code like this and could any body help me with editing code and send me code. i am getting city values but i can't location values of city from database.thanks in advance
how to implement ajax in struts2 to operate on selectbox in jsp
how to implement ajax in struts2 to operate on selectbox in jsp  I am doing a project on struts2 in which i have a jsp page which has 2 select boxes like </s:form>` ` now i want that when i select a district
Advertisements
Second Section
 Second SectionPrev Appendix A. First Appendix Next     Second Section The Sun Certified Business Component Developer (SCBCD) for the Java 2 Platform, Enterprise
select employee name based on his/her designation in selectbox
selectbox in jsp it is possible? if it is possible pls send me that code urgent
One-Millionth of a second is referred as
One-Millionth of a second is referred as  One-Millionth of a second is referred as -? 1. Microsecond 2. Millisecond 3. Hour 4. Minute 5. All of the above   Answer: 1. Microsecond
One-thousand of a second is called
One-thousand of a second is called  One-thousand of a second is called- 1. Microsecond 2. Millisecond 3. Hour 4. Minute 5. All of the above   Answer: 1. Microsecond
Second level cache
Second level cache  Hi, I have been asked one question which I have no idea about. It's like I have enabled second level caching and the data has... and how do I refresh( reload) my second level cache. Please advise, and ignore my
DYNAMIC BINDING
DYNAMIC BINDING  WHAT IS DYNAMIC BINDING
dynamic report
dynamic report  i need complete code for generating dynamic report in jsp
dynamic polymorphism
dynamic polymorphism  Develop with suitable hierarchy, classes for Point, Shape, Rectangle, Square, Circle, Ellipse, Triangle, Polygon, etc. Design a simple test application to demonstrate dynamic polymorphism
how to select second combobox value .
how to select second combobox value .  I requirement is , i have two combo box, i am selected first combo box value then automatically second combo box value show ,But this both combo box value i retrieves in database. please
Dynamic keyword
Dynamic keyword  hi....... What is the dynamic keyword used for in flex? give me the answer ASAP Thanks  Ans: Dynamic keyword-> Specifies that instances of a class may possess dynamic properties added
dynamic form
dynamic form  I need to make a dynamic form using php, for example, i... dropdown, the states belong to that countries will get displayed in second dropdown from database. And when the user select state from the second dropdown
dynamic polymorphism
dynamic polymorphism  give an example for dynamic polymorphism?   Dynamic polymorphism is where a class overrides a superclass method... seen at runtime, so they are considered dynamic. Here is an example
dynamic textfields
dynamic textfields  Hi, I am a fresher and joined recently in one company. they gave me a desktop application project using swings.here is my detailed spec Screen 1 - The user enters the ingredients from a food product, saves
dynamic jquery statement
dynamic jquery statement  dynamic jquery statement
Dynamic form
Dynamic form  I need to make a dynamic form using jsp for example, i will need a list of items which when we select one option another list is modified ( like 2 lists of countries and citys ), and also a radio button wich once
dynamic calender
dynamic calender  hi i need the code to "insert date using GUI"   Hi Friend, Try the following code: import java.awt.*; import java.awt.event.*; import javax.swing.*; class DatePicker{ int month
Second Normal Form (2NF)
Second Normal Form (2NF)       Second Normal Form (2NF) The concept of remove the delicacy of data comes in the Second Normal Form (2NF). A.  It should meet all
dynamic query
dynamic query  DECLARE QUERY VARCHAR2(32767); FIN_QUERY VARCHAR2(32767); CURSOR C IS (select distinct PORTFOLIO from MPE_TEST1); CURSOR C2 IS SELECT DISTINCT PORTFOLIO_LEVEL, PORTFOLIO FROM MPE_TEST1 ORDER
create dynamic array in javascript
create dynamic array in javascript  How to create dynamic array in javascript
php dynamic array checking
php dynamic array checking  php dynamic array checking
php dynamic array checking
php dynamic array checking  php dynamic array checking
PHP Dynamic CheckBox
PHP Dynamic CheckBox  Help with Dynamic Checkbox in PHP
problem in selecting second arraylist from mysql database
, but i want second list to be dynamic from database. Please, help me out. Thank...problem in selecting second arraylist from mysql database  Hi...', it should give list of that selected one in second list, BUT THAT list should be stored
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages
Dynamic include jsp
Dynamic include jsp  I need dynamic include jsp page with an example
static page and dynamic pages?
static page and dynamic pages?  what is the diff between static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages adv and disadv
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
Tutorials   
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java

Ads

 
Advertisement null

Ads