Hi Guys,
It's been a while, I've got a small problem that I could do with your
expertise on.
As you know (I Think) I build websites for recruitment agencies, part of the
website includes a job board facility and for job form entry I used a normal
form with a normal textbox, however what I'm finding now is that a lot of
recruitment consultants are pasting the job description into the textbox,
which when submitted is resulting in most of the text not being entered!!!
Is there any way around this?
I've attached the code -
Thank you
<%@LANGUAGE="VB SCRIPT" CODEPAGE="65001 "%>
<!--#include file="../Connections/recruta2.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.Se rverVariables(" SCRIPT_NAME"))
If (Request.QueryS tring <"") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEnco de(Request.Quer yString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(conditio n, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<% Session("NEWVAC ANCYTITLE") = Request.Form("t itle") %>
<% Session("NEWVAC ANCYSECTOR") = Request.Form("j obtype") %>
<% Session("NEWVAC ANCYLOCATION") = Request.Form("l ocation") %>
<%
If (CStr(Request(" MM_insert")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateOb ject ("ADODB.Command ")
MM_editCmd.Acti veConnection = MM_recruta2_STR ING
MM_editCmd.Comm andText = "INSERT INTO dbo.Vacancy (VacancyTitle,
VacancyCategory , VacancyLocation , VacancyType, VacancyPaye, VacancyDuration ,
VacancyReferenc e, VacancyExpiryDa te, VacancyDescript ion, VacancyEmployer ID,
VacancyEmployee ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
MM_editCmd.Prep ared = true
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram1", 202,
1, 50, Request.Form("t itle")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram2", 202,
1, 50, Request.Form("j obtype")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram3", 202,
1, 50, Request.Form("l ocation")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram4", 202,
1, 50, Request.Form("c ontract")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram5", 202,
1, 50, Server.HTMLEnco de(Request.Form ("payrate")) ) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram6", 202,
1, 50, Request.Form("d uration")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram7", 202,
1, 50, Request.Form("r eference")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram8", 135,
1, -1, MM_IIF(Request. Form("expirydat e2"), Request.Form("e xpirydate2"),
null)) ' adDBTimeStamp
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram9", 201,
1, -1, Server.HTMLEnco de(Request.Form ("description") )) ' adLongVarChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram10", 5, 1,
-1, MM_IIF(Request. Form("SITEID"), Request.Form("S ITEID"), null)) ' adDouble
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram11", 5, 1,
-1, MM_IIF(Request. Form("Employee" ), Request.Form("E mployee"), null)) '
adDouble
MM_editCmd.Exec ute
MM_editCmd.Acti veConnection.Cl ose
' append the query string to the redirect URL
Dim MM_editRedirect Url
MM_editRedirect Url = "afternewvacanc y.asp"
If (Request.QueryS tring <"") Then
If (InStr(1, MM_editRedirect Url, "?", vbTextCompare) = 0) Then
MM_editRedirect Url = MM_editRedirect Url & "?" & Request.QuerySt ring
Else
MM_editRedirect Url = MM_editRedirect Url & "&" & Request.QuerySt ring
End If
End If
Response.Redire ct(MM_editRedir ectUrl)
End If
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<script type="text/javascript" src="../Scripts/currentdate.js" ></script>
<%
Function fRandomReferenc e()
Const sValidChars = "abcdefghijklmn opqrstuvxyz"
Dim nCount
Dim sRet
Dim nNumber
Dim nLength
Randomize
nLength = Len( sValidChars )
For nCount = 1 To 10
nNumber = Int((nLength * Rnd) + 1)
sRet = sRet & Mid( sValidChars, nNumber, 1 )
Next
fRandomReferenc e = sRet
End Function
%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Backoffi ce</title>
<meta name="robots" content="noinde x,nofollow">
<link href="Styles/clientsheet.css " rel="stylesheet " type="text/css">
<link href="Styles/clientforms.css " rel="stylesheet " type="text/css">
<meta http-equiv="refresh" content="1201;U RL=index.asp">
<script src="../SpryAssets/SpryCollapsible Panel.js"
type="text/javascript"></script>
<script type="text/javascript" src="../Scripts/reflection.js"> </script>
<script src="../calendar/calendar.js"></script>
<link href="../SpryAssets/SpryCollapsible Panel.css" rel="stylesheet "
type="text/css" />
<script type="text/javascript" src="../Scripts/check.js"></script>
</head>
<body>
<div id="wrapper">
<table border="0" cellpadding="0" cellspacing="0" class="table">
<tr>
<td class="toptable backoffice"><ta ble border="0" cellpadding="0"
cellspacing="0" class="toptable backoffice">
<tr>
<td><img src="../images/recrutalg.jpg" alt="Recruta" width="179"
class="reflect rheight50 ropacity33" id="recrlogo" /></td>
<td><table border="0" cellpadding="0" cellspacing="0"
class="toptable backoffice2">
<tr>
<td class="recrutad ate"><script language="JavaS cript"
type="text/javascript">
document.write( "<span
class=\"datetex t\">"+doClock(" W0","%20","D0", "%20","M0","%20 ","Y0")+"</span>");
</script></td>
</tr>
<tr>
<td class="loggedin "><%= Session("NAME") %you are logged in
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="tdrecrut anavbar"><ul class="nav">
<% If Not adminlevel.EOF Or Not adminlevel.BOF Then %>
<li><a href="pagelist. asp">Page Manager</a></li>
<li><a href="consultan tlist.asp">Cons ultant Manager</a></li>
<li><a href="newslist. asp">News Manager</a></li>
<li><a href="jobsearch criteria.asp">J obSearch Manager</a></li>
<% End If ' end Not adminlevel.EOF Or NOT adminlevel.BOF %>
<li><a href="oldregcan dlist.asp">Regi stered Users</a></li>
<li><a href="jbemgnt.a sp">Jobs by Email Manager</a></li>
<li><a href="account.a sp">Account</a></li>
<li><a href="logout.as p">Log Out</a></li>
</ul></td>
</tr>
<tr>
<td><table border="0" cellpadding="0" cellspacing="0"
class="recrutam ainarea">
<tr>
<td valign="top" class="tdrightr ecrutamain"><h1 >New Vacancy </h1>
<p class="invalid" >Please complete all fields </p>
<form ACTION="<%=MM_e ditAction%>" METHOD="POST" name="form1"
id="form1">
<table border="0" cellpadding="0" cellspacing="0"
class="outervac ancytable">
<tr>
<td class="editvaca ncyvalue">Vacan cy Title:</td>
<td class="editvaca ncyform"><label >
<input name="title" type="text" id="title"
maxlength="50" />
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Secto r:</td>
<td class="editvaca ncyform"><label >
<select name="jobtype" id="jobtype">
<option selected="selec ted" value="">Select </option>
<%
While (NOT jobsectors.EOF)
%>
<option
value="<%=(jobs ectors.Fields.I tem("Jobtype"). Value)%>"><%=(j obsectors.Field s.Item("Jobtype ").Value)%> </option>
<%
jobsectors.Move Next()
Wend
If (jobsectors.Cur sorType 0) Then
jobsectors.Move First
Else
jobsectors.Requ ery
End If
%>
</select>
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Locat ion:</td>
<td class="editvaca ncyform"><label >
<select name="location" id="location">
<option selected="selec ted" value="">Select </option>
<%
While (NOT joblocations.EO F)
%>
<option
value="<%=(jobl ocations.Fields .Item("JobLocat ion").Value)%>" ><%=(joblocatio ns.Fields.Item( "JobLocation"). Value)%></option>
<%
joblocations.Mo veNext()
Wend
If (joblocations.C ursorType 0) Then
joblocations.Mo veFirst
Else
joblocations.Re query
End If
%>
</select>
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Type: </td>
<td class="editvaca ncyform"><label >
<select name="contract" id="contract">
<option selected="selec ted" value="">Select </option>
<option value="Temporar y">Temporary </option>
<option value="Permanen t">Permanent </option>
<option value="Contract ">Contract</option>
</select>
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Pay Rate:</td>
<td class="editvaca ncyform"><label >
<input name="payrate" type="text" id="payrate"
maxlength="50" />
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Durat ion:</td>
<td class="editvaca ncyform"><label >
<input name="duration" type="text" id="duration"
maxlength="50" />
<input name="reference " type="hidden" id="reference"
value="<%=fRand omReference()%> " />
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Adver t Expires on:</td>
<td class="editvaca ncyform">
<input name="expirydat e2" type="text" id="expirydate2 "
onFocus="this.s elect();lcs(thi s)"
onClick="event. cancelBubble=tr ue;this.select( );lcs(this)">
</td>
</tr>
<tr>
<td class="editvaca ncyvalue">Descr iption:</td>
<td class="editvaca ncyform"><label >
<textarea name="descripti on" id="description "
rows="14"></textarea>
</label></td>
</tr>
<tr>
<td><input name="SITEID" type="hidden" id="SITEID"
value="<%= Session("SITEID ") %>" />
<input name="Employee" type="hidden" id="Employee"
value="<%= Session("EMPLOY EEID") %>" /></td>
<td class="editbutt on"><label>
<input name="submit" type="submit" id="submit"
value="Submit" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert " value="form1" />
</form>
I've removed some of the not important stuff -- thanks
It's been a while, I've got a small problem that I could do with your
expertise on.
As you know (I Think) I build websites for recruitment agencies, part of the
website includes a job board facility and for job form entry I used a normal
form with a normal textbox, however what I'm finding now is that a lot of
recruitment consultants are pasting the job description into the textbox,
which when submitted is resulting in most of the text not being entered!!!
Is there any way around this?
I've attached the code -
Thank you
<%@LANGUAGE="VB SCRIPT" CODEPAGE="65001 "%>
<!--#include file="../Connections/recruta2.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.Se rverVariables(" SCRIPT_NAME"))
If (Request.QueryS tring <"") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEnco de(Request.Quer yString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(conditio n, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<% Session("NEWVAC ANCYTITLE") = Request.Form("t itle") %>
<% Session("NEWVAC ANCYSECTOR") = Request.Form("j obtype") %>
<% Session("NEWVAC ANCYLOCATION") = Request.Form("l ocation") %>
<%
If (CStr(Request(" MM_insert")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateOb ject ("ADODB.Command ")
MM_editCmd.Acti veConnection = MM_recruta2_STR ING
MM_editCmd.Comm andText = "INSERT INTO dbo.Vacancy (VacancyTitle,
VacancyCategory , VacancyLocation , VacancyType, VacancyPaye, VacancyDuration ,
VacancyReferenc e, VacancyExpiryDa te, VacancyDescript ion, VacancyEmployer ID,
VacancyEmployee ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
MM_editCmd.Prep ared = true
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram1", 202,
1, 50, Request.Form("t itle")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram2", 202,
1, 50, Request.Form("j obtype")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram3", 202,
1, 50, Request.Form("l ocation")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram4", 202,
1, 50, Request.Form("c ontract")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram5", 202,
1, 50, Server.HTMLEnco de(Request.Form ("payrate")) ) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram6", 202,
1, 50, Request.Form("d uration")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram7", 202,
1, 50, Request.Form("r eference")) ' adVarWChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram8", 135,
1, -1, MM_IIF(Request. Form("expirydat e2"), Request.Form("e xpirydate2"),
null)) ' adDBTimeStamp
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram9", 201,
1, -1, Server.HTMLEnco de(Request.Form ("description") )) ' adLongVarChar
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram10", 5, 1,
-1, MM_IIF(Request. Form("SITEID"), Request.Form("S ITEID"), null)) ' adDouble
MM_editCmd.Para meters.Append MM_editCmd.Crea teParameter("pa ram11", 5, 1,
-1, MM_IIF(Request. Form("Employee" ), Request.Form("E mployee"), null)) '
adDouble
MM_editCmd.Exec ute
MM_editCmd.Acti veConnection.Cl ose
' append the query string to the redirect URL
Dim MM_editRedirect Url
MM_editRedirect Url = "afternewvacanc y.asp"
If (Request.QueryS tring <"") Then
If (InStr(1, MM_editRedirect Url, "?", vbTextCompare) = 0) Then
MM_editRedirect Url = MM_editRedirect Url & "?" & Request.QuerySt ring
Else
MM_editRedirect Url = MM_editRedirect Url & "&" & Request.QuerySt ring
End If
End If
Response.Redire ct(MM_editRedir ectUrl)
End If
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<script type="text/javascript" src="../Scripts/currentdate.js" ></script>
<%
Function fRandomReferenc e()
Const sValidChars = "abcdefghijklmn opqrstuvxyz"
Dim nCount
Dim sRet
Dim nNumber
Dim nLength
Randomize
nLength = Len( sValidChars )
For nCount = 1 To 10
nNumber = Int((nLength * Rnd) + 1)
sRet = sRet & Mid( sValidChars, nNumber, 1 )
Next
fRandomReferenc e = sRet
End Function
%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Backoffi ce</title>
<meta name="robots" content="noinde x,nofollow">
<link href="Styles/clientsheet.css " rel="stylesheet " type="text/css">
<link href="Styles/clientforms.css " rel="stylesheet " type="text/css">
<meta http-equiv="refresh" content="1201;U RL=index.asp">
<script src="../SpryAssets/SpryCollapsible Panel.js"
type="text/javascript"></script>
<script type="text/javascript" src="../Scripts/reflection.js"> </script>
<script src="../calendar/calendar.js"></script>
<link href="../SpryAssets/SpryCollapsible Panel.css" rel="stylesheet "
type="text/css" />
<script type="text/javascript" src="../Scripts/check.js"></script>
</head>
<body>
<div id="wrapper">
<table border="0" cellpadding="0" cellspacing="0" class="table">
<tr>
<td class="toptable backoffice"><ta ble border="0" cellpadding="0"
cellspacing="0" class="toptable backoffice">
<tr>
<td><img src="../images/recrutalg.jpg" alt="Recruta" width="179"
class="reflect rheight50 ropacity33" id="recrlogo" /></td>
<td><table border="0" cellpadding="0" cellspacing="0"
class="toptable backoffice2">
<tr>
<td class="recrutad ate"><script language="JavaS cript"
type="text/javascript">
document.write( "<span
class=\"datetex t\">"+doClock(" W0","%20","D0", "%20","M0","%20 ","Y0")+"</span>");
</script></td>
</tr>
<tr>
<td class="loggedin "><%= Session("NAME") %you are logged in
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="tdrecrut anavbar"><ul class="nav">
<% If Not adminlevel.EOF Or Not adminlevel.BOF Then %>
<li><a href="pagelist. asp">Page Manager</a></li>
<li><a href="consultan tlist.asp">Cons ultant Manager</a></li>
<li><a href="newslist. asp">News Manager</a></li>
<li><a href="jobsearch criteria.asp">J obSearch Manager</a></li>
<% End If ' end Not adminlevel.EOF Or NOT adminlevel.BOF %>
<li><a href="oldregcan dlist.asp">Regi stered Users</a></li>
<li><a href="jbemgnt.a sp">Jobs by Email Manager</a></li>
<li><a href="account.a sp">Account</a></li>
<li><a href="logout.as p">Log Out</a></li>
</ul></td>
</tr>
<tr>
<td><table border="0" cellpadding="0" cellspacing="0"
class="recrutam ainarea">
<tr>
<td valign="top" class="tdrightr ecrutamain"><h1 >New Vacancy </h1>
<p class="invalid" >Please complete all fields </p>
<form ACTION="<%=MM_e ditAction%>" METHOD="POST" name="form1"
id="form1">
<table border="0" cellpadding="0" cellspacing="0"
class="outervac ancytable">
<tr>
<td class="editvaca ncyvalue">Vacan cy Title:</td>
<td class="editvaca ncyform"><label >
<input name="title" type="text" id="title"
maxlength="50" />
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Secto r:</td>
<td class="editvaca ncyform"><label >
<select name="jobtype" id="jobtype">
<option selected="selec ted" value="">Select </option>
<%
While (NOT jobsectors.EOF)
%>
<option
value="<%=(jobs ectors.Fields.I tem("Jobtype"). Value)%>"><%=(j obsectors.Field s.Item("Jobtype ").Value)%> </option>
<%
jobsectors.Move Next()
Wend
If (jobsectors.Cur sorType 0) Then
jobsectors.Move First
Else
jobsectors.Requ ery
End If
%>
</select>
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Locat ion:</td>
<td class="editvaca ncyform"><label >
<select name="location" id="location">
<option selected="selec ted" value="">Select </option>
<%
While (NOT joblocations.EO F)
%>
<option
value="<%=(jobl ocations.Fields .Item("JobLocat ion").Value)%>" ><%=(joblocatio ns.Fields.Item( "JobLocation"). Value)%></option>
<%
joblocations.Mo veNext()
Wend
If (joblocations.C ursorType 0) Then
joblocations.Mo veFirst
Else
joblocations.Re query
End If
%>
</select>
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Type: </td>
<td class="editvaca ncyform"><label >
<select name="contract" id="contract">
<option selected="selec ted" value="">Select </option>
<option value="Temporar y">Temporary </option>
<option value="Permanen t">Permanent </option>
<option value="Contract ">Contract</option>
</select>
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Pay Rate:</td>
<td class="editvaca ncyform"><label >
<input name="payrate" type="text" id="payrate"
maxlength="50" />
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Durat ion:</td>
<td class="editvaca ncyform"><label >
<input name="duration" type="text" id="duration"
maxlength="50" />
<input name="reference " type="hidden" id="reference"
value="<%=fRand omReference()%> " />
</label></td>
</tr>
<tr>
<td class="editvaca ncyvalue">Adver t Expires on:</td>
<td class="editvaca ncyform">
<input name="expirydat e2" type="text" id="expirydate2 "
onFocus="this.s elect();lcs(thi s)"
onClick="event. cancelBubble=tr ue;this.select( );lcs(this)">
</td>
</tr>
<tr>
<td class="editvaca ncyvalue">Descr iption:</td>
<td class="editvaca ncyform"><label >
<textarea name="descripti on" id="description "
rows="14"></textarea>
</label></td>
</tr>
<tr>
<td><input name="SITEID" type="hidden" id="SITEID"
value="<%= Session("SITEID ") %>" />
<input name="Employee" type="hidden" id="Employee"
value="<%= Session("EMPLOY EEID") %>" /></td>
<td class="editbutt on"><label>
<input name="submit" type="submit" id="submit"
value="Submit" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert " value="form1" />
</form>
I've removed some of the not important stuff -- thanks
Comment