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



Home Answers Viewqa JavaScriptQuestions second selectbox of dynamic
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


bolagani venkatarao
second selectbox of dynamic
0 Answer(s)      2 years and 5 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>

Advertisement
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
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 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
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
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 static page and dynamic pages
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
 

 

 

DMCA.com