dynamic select box
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>
View Answers
Ads
Related Tutorials/Questions & Answers:
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
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
Advertisements
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
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
JavaScript Combo Box Validation
JavaScript Combo
Box Validation
This application illustrates how to validate the combo
box using JavaScript
validation.
In this example we create a combo
box of different
dynamic form
dynamic form I need to make a
dynamic form using php, for example, i will need a list of items which when we
select one option another list... dependent dropdown lists using Ajax. when the user
select country name from the first
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... list consisting of country names. When the user
select any country name
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 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
combo box
combo box Hi,
[_|] dropdown
box... a screen like this using jsp-servlet(or DAO,DTO),in that drop down
box i should get... to that user in left list.when we
select module from left list and click INCLUDE button