Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Show sub category when user checks on main category

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Show sub category when user checks on main category

Postby Avin10889 » Thu Jul 25, 2013 9:51 am

hiii..
I want to add a location in this form. In location i insert suppose Central mumbai.Navi mumbai,south mumbai,Western mumbai. when our cursor is on the western mumbai then every station are show in wester mumbai virar ,borivali.dadar etc.....
Here is my code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<table id="employer_font" align="center" width="463" border="1" cellpadding="2" cellspacing="5">

<tr>
<td width="78" style="border-width : 0px;">First Name:</td>
<td style="border-width : 0px;" rowspan=9 colspan=1 background="images/hindi new.jpg"> <p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></td>
<td width="233" style="border-width : 0px;"><input type="text" name="candidatefname" value="" maxlength="25"/></td>
</tr>

<tr valign="top">
<td style="border-width : 0px;" >Last Name :</td>
<td style="border-width : 0px;"><input type="text" name="candidatelname" value="" maxlength="25"/></td>
</tr>

<tr valign="top">
<td style="border-width : 0px;">Mobile No * :</td>
<td style="border-width : 0px;"><input type="text" name="condidatecontact" value="" maxlength="10"/></td>
</tr>

<tr valign="top">
<td style="border-width : 0px;">Gender :</td>
<td style="border-width : 0px;">
<input type="radio" name="cangender" value="Male" checked="true"/>Male &nbsp;
<input type="radio" name="cangender" value="Female"/>Female </td>
</tr>

<tr valign="top">
<td style="border-width : 0px;">Type of job :</td>
<td style="border-width : 0px;">
<select name="cadidatetypeofjob">
<option selected value="null">-- Jobs --</option>
<?php
$job = array("Peon", "Helper","Delivery boy","Driver","Domestic Help","House-Maid","Baby-sitter","Cook","Salesman","Marketing","Data Entry Operator","Office Assistant","Carpenter","Electrician","Painter","Security Guard","Plumber","Mason");

asort($job);

foreach($job as $value)
{
echo"<option value='$value'>$value</option>\n";
}
?>
</select> </td>
</tr>

<tr valign="top">
<td style="border-width : 0px;">City :</td>
<td style="border-width : 0px;">
<select name="candidatecity">
<option selected value="null">-- Select City --</option>
<?php
$city = array("Western Mumbai ","Central Mumbai" ,"Navi Mumbai","South Mumbai","Thane", "Aurangabad", "Pune","Nashik", "Nagpur","Next cities coming soon");
asort($city);
foreach($city as $value)
{
echo"<option value='$value'>$value</option>\n";
}
?>
</select>
</td>
</tr>


<tr valign="top">
<td style="border-width : 0px;">Location:</td>
<td style="border-width : 0px;">
<select name="candidateLocation">
<option selected value="null">-- Select Location --</option>
<?php
$Location= array("Virar","Miraroad","Borivali","Andheri","Bandra","Dadar");
asort($location);
foreach($location as $value)
{
echo"<option value='$value'>$value</option>\n";
}
?>

</select>
</td>
</tr>



<tr valign="top">
<td style="border-width : 0px;">Address :</td>
<td style="border-width : 0px;"><textarea name="cadidateaddress" rows="3" cols="30%" maxlength="150"></textarea></td>
</tr>

<tr valign="top">
<td style="border-width : 0px;">Pincode :</td>                       
<td style="border-width : 0px;"> </textarea>
<input type="text" value="" name="candidatepincode" maxlength="6" / ></td>
</tr>



<tr valign="top">
<td style="border-width : 0px;"> </td>
<td style="border-width : 0px;"><input type="submit" name="submit" value="Submit"></td>
<td style="border-width : 0px;"><input type="reset" value="Reset"></td>
</tr>
</table>
</body>
</html>
Avin10889
New php-forum User
New php-forum User
 
Posts: 1
Joined: Thu Jul 18, 2013 8:19 am

Re: Show sub category when user checks on main category

Postby johnj » Thu Jul 25, 2013 8:00 pm

read about show() and hide() in jquery. Then, write a dropdown which will be shown with the subcategories when the main category is clicked.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: icor1031 and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.