Php coding of 2 level drop down
Posted: Sun May 18, 2014 4:00 pm
Hi,
I have the following registration form on our website (this is only part of the code).
The last line of this code is about States in Australia. We are now adding some new countries like New Zealand and I need to ad new states for new Zealand but I want them to show separately in the drop down box like on the following
website location field : http://www.seek.com.au/
So the country would be in Bold and then you would have a second level of information per country with the states.
Could you please let me know how to modify my code to do that ? (my php coding is extremely basic so please feel free to treat me as a dummy coder)
Thanks
<table width="70%" border="0" style="margin:0 auto;">
<tr>
<td colspan="3" style="text-align:center">
<h4 style="text-align:left">Register now and join the fun!</h4>
<p style="text-align:left">Please fill out the form below to register. We can only accept registrations with your valid email address. We will contact you when you have been selected for a research project.</p>
</td>
</tr>
<tr>
<td width="24%" align="right">Title*</td>
<td width="2%"> </td>
<td width="24%">[select* Title "Mr." "Mrs." "Ms." "Miss." "Dr." "Prof."]</td>
</tr>
<tr>
<td align="right">First Name*</td>
<td> </td>
<td>[text* FirstName class:textbg]</td>
</tr>
<tr>
<td align="right">Last Name*</td>
<td> </td>
<td>[text* LastName class:textbg]</td>
</tr>
<tr>
<td align="right">Street Address</td>
<td> </td>
<td>[text StreetAddress class:textbg]</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>[text StreetAddress2 class:textbg]</td>
</tr>
<tr>
<td align="right">Suburb*</td>
<td> </td>
<td>[text* Suburb class:textbg]</td>
</tr>
<tr>
<td align="right">State*</td>
<td> </td>
<td>[select* State "" "ACT" "NSW" "NT" "QLD" "SA" "TAS" "VIC" "WA"]</td>
</tr>
<tr>
I have the following registration form on our website (this is only part of the code).
The last line of this code is about States in Australia. We are now adding some new countries like New Zealand and I need to ad new states for new Zealand but I want them to show separately in the drop down box like on the following
website location field : http://www.seek.com.au/
So the country would be in Bold and then you would have a second level of information per country with the states.
Could you please let me know how to modify my code to do that ? (my php coding is extremely basic so please feel free to treat me as a dummy coder)
Thanks
<table width="70%" border="0" style="margin:0 auto;">
<tr>
<td colspan="3" style="text-align:center">
<h4 style="text-align:left">Register now and join the fun!</h4>
<p style="text-align:left">Please fill out the form below to register. We can only accept registrations with your valid email address. We will contact you when you have been selected for a research project.</p>
</td>
</tr>
<tr>
<td width="24%" align="right">Title*</td>
<td width="2%"> </td>
<td width="24%">[select* Title "Mr." "Mrs." "Ms." "Miss." "Dr." "Prof."]</td>
</tr>
<tr>
<td align="right">First Name*</td>
<td> </td>
<td>[text* FirstName class:textbg]</td>
</tr>
<tr>
<td align="right">Last Name*</td>
<td> </td>
<td>[text* LastName class:textbg]</td>
</tr>
<tr>
<td align="right">Street Address</td>
<td> </td>
<td>[text StreetAddress class:textbg]</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>[text StreetAddress2 class:textbg]</td>
</tr>
<tr>
<td align="right">Suburb*</td>
<td> </td>
<td>[text* Suburb class:textbg]</td>
</tr>
<tr>
<td align="right">State*</td>
<td> </td>
<td>[select* State "" "ACT" "NSW" "NT" "QLD" "SA" "TAS" "VIC" "WA"]</td>
</tr>
<tr>