Hi,
We have a form that allows people to apply for a job. One of the questions is where did you hear about the vacancy. Currently when the user selects their choice the answer is recorded in the datbase then the page reloads. When the page reloads it looks up their answer and depending on what it finds changes the wording and also for some choices shows a <textarea> element that allows them to expand on their answer.
This is fine to an extent but ideally what I would like to do is to do it all client side which would mean the page doesn't have to reload so the whole thing will be a bit neater and it will remove some security problems.
What is the best way to go about this? Here is my code so far:
<tr>
<td colspan="2">
<span class="text2">
<strong>
<font color="navy">Where did you hear about the vacancy?</font></strong>
<font color="red">>></font>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<select name="HeardViaCode" class="text2" onchange=form.submit()>
<option value="">Please Select</option>
<option value="PUB" <% If HeardViaCode="PUB" Then Response.Write("SELECTED") %>>Publication</option>
<option value="LAW" <% If HeardViaCode="LAW" Then Response.Write("SELECTED") %>>Law Fair</option>
<option value="BWB" <% If HeardViaCode="BWB" Then Response.Write("SELECTED") %>>BWB Website</option>
<option value="WRI" <% If HeardViaCode="WRI" Then Response.Write("SELECTED") %>>Enquired in writing</option>
<option value="TOT" <% If HeardViaCode="TOT" Then Response.Write("SELECTED") %>>Totally Legal Website</option>
<option value="REP" <% If HeardViaCode="REP" Then Response.Write("SELECTED") %>>Reputation/word of mouth</option>
<option value="OTH" <% If HeardViaCode="OTH" Then Response.Write("SELECTED") %>>Other</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<span class="text2">
<%
If HeardViaCode="PUB" Then
Response.Write("Please state title(s):")
Response.Write("<br>")
End If
If HeardViaCode="LAW" Then
Response.Write("Please state which:")
Response.Write("<br>")
End If
If HeardViaCode="OTH" Then
Response.Write("Please state:")
Response.Write("<br>")
End If
%>
</td>
</tr>
<tr>
<td colspan="2">
<%
Select Case HeardViaCode
Case "PUB", "LAW", "OTH"
%>
<textarea name="HeardViaText" class="text2" cols="40" rows="5"><% = HeardViaText %></textarea>
<%
Case Else
End Select
%>
</td>
</tr>
Thanks very much
Ed
We have a form that allows people to apply for a job. One of the questions is where did you hear about the vacancy. Currently when the user selects their choice the answer is recorded in the datbase then the page reloads. When the page reloads it looks up their answer and depending on what it finds changes the wording and also for some choices shows a <textarea> element that allows them to expand on their answer.
This is fine to an extent but ideally what I would like to do is to do it all client side which would mean the page doesn't have to reload so the whole thing will be a bit neater and it will remove some security problems.
What is the best way to go about this? Here is my code so far:
<tr>
<td colspan="2">
<span class="text2">
<strong>
<font color="navy">Where did you hear about the vacancy?</font></strong>
<font color="red">>></font>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<select name="HeardViaCode" class="text2" onchange=form.submit()>
<option value="">Please Select</option>
<option value="PUB" <% If HeardViaCode="PUB" Then Response.Write("SELECTED") %>>Publication</option>
<option value="LAW" <% If HeardViaCode="LAW" Then Response.Write("SELECTED") %>>Law Fair</option>
<option value="BWB" <% If HeardViaCode="BWB" Then Response.Write("SELECTED") %>>BWB Website</option>
<option value="WRI" <% If HeardViaCode="WRI" Then Response.Write("SELECTED") %>>Enquired in writing</option>
<option value="TOT" <% If HeardViaCode="TOT" Then Response.Write("SELECTED") %>>Totally Legal Website</option>
<option value="REP" <% If HeardViaCode="REP" Then Response.Write("SELECTED") %>>Reputation/word of mouth</option>
<option value="OTH" <% If HeardViaCode="OTH" Then Response.Write("SELECTED") %>>Other</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<span class="text2">
<%
If HeardViaCode="PUB" Then
Response.Write("Please state title(s):")
Response.Write("<br>")
End If
If HeardViaCode="LAW" Then
Response.Write("Please state which:")
Response.Write("<br>")
End If
If HeardViaCode="OTH" Then
Response.Write("Please state:")
Response.Write("<br>")
End If
%>
</td>
</tr>
<tr>
<td colspan="2">
<%
Select Case HeardViaCode
Case "PUB", "LAW", "OTH"
%>
<textarea name="HeardViaText" class="text2" cols="40" rows="5"><% = HeardViaText %></textarea>
<%
Case Else
End Select
%>
</td>
</tr>
Thanks very much
Ed