Hi,
I have a Table which should be filtred with the Dropdown list onchange.
I have no Idea to do this with chronoform. I have tried with the following coding it is not working.
Kindly help me.
I used this coding in Form HTML:
This is the coding used in the Javascript
Regards,
Shoaib.
I have a Table which should be filtred with the Dropdown list onchange.
I have no Idea to do this with chronoform. I have tried with the following coding it is not working.
Kindly help me.
I used this coding in Form HTML:
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Donation Year</label>
<select class="cf_inputbox" id="select_2" size="1" title="" name="Donation_For_Year" onchange = compfuntion() >
<option value="">Choose Option</option>
<?php
$result = mysql_query( "SELECT Project_Year FROM Project_Year" )
or die("SELECT Error: ".mysql_error());
while ($line = mysql_fetch_array($result)) {
print ("<OPTION value=".$line[0].">$line[0]</OPTION>"); }
?>
</select>
</div>
<div class="cfclear"> </div>
</div>
This is the coding used in the Javascript
function compfuntion()
{
<?php
print "<br></br>";
print "<br></br>";
print "<br></br>";
print "<br></br>";
print "<h3> Projects in Progress </h3>";
$result = mysql_query( "SELECT p.Project_Name,p.Activity_Name,v.Village, v.Mandal, v.District, v.State,p.Estimated_Cost_Rs,p.Funds_Mobilized_Dollar,DATE_FORMAT(p.Expected_Start_Date,'%m-%d-%Y'), DATE_FORMAT(p.Expected_Complete_Date,'%m-%d-%Y') FROM Project as p
JOIN Project_Location as v ON v.fabrik_internal_id = p.Village WHERE p.Status_Id ='In Progress'" )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<P>";
print "<table width=950 border=0>\n";
print "<th>Project Name</th>";
print "<th>Activity Name</th>";
print "<th>Village</th>";
print "<th>Mandal</th>";
print "<th>District</th>";
print "<th>State</th>";
print "<th>Estimated Cost</th>";
print "<th>Funds Mobilized</th>";
//print "<th>Still Funds Required</th>";
print "<th>Start Date</th>";
print "<th>Estimated Completion Date</th>";
while ($get_info = mysql_fetch_row($result))
{
print "<tr>\n";
foreach ($get_info as $field)
print "\t <td><font face=arial size=1/>$field</font></td> \n ";
print "</tr>\n";
}
print "</table>\n";
?>
}
Regards,
Shoaib.