473,769 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp vbscript textbox paste from word problem

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
Oct 9 '08 #1
5 3431
GTN170777 <GT*******@disc ussions.microso ft.comwrote:
>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!!!
You didn't say which textbox is getting the problem, but I see three
<input type="text" ...controls, named "title", "payrate", and
"duration", that have a maxlength attribute of 50. Anything longer
then 50 characters that's pasted into any of these will be truncated.

--
Tim Slattery
MS MVP(Shell/User)
Sl********@bls. gov
http://members.cox.net/slatteryt
Oct 9 '08 #2
Sorry Tim, it is actually the textarea description.

Many thanks

"Tim Slattery" wrote:
GTN170777 <GT*******@disc ussions.microso ft.comwrote:
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!!!

You didn't say which textbox is getting the problem, but I see three
<input type="text" ...controls, named "title", "payrate", and
"duration", that have a maxlength attribute of 50. Anything longer
then 50 characters that's pasted into any of these will be truncated.

--
Tim Slattery
MS MVP(Shell/User)
Sl********@bls. gov
http://members.cox.net/slatteryt
Oct 9 '08 #3
Gazing into my crystal ball I observed =?Utf-8?B?R1ROMTcwNzc 3?=
<GT*******@disc ussions.microso ft.comwriting in
news:9E******** *************** ***********@mic rosoft.com:
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?
You can use client side javascript to show the user how many characters
are left, and alert the user that the data was truncated.

Server side, check the length of the data, and return an error message
to the client if it is too long.

Including instructions on the form that the input should only be a
certain amount of characters will also help.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Oct 9 '08 #4
"GTN170777" <GT*******@disc ussions.microso ft.comwrote in message
news:9E******** *************** ***********@mic rosoft.com...
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?
Silly question time... What's the defined size of the VacancyDescript ion
column in the database?

- Bob.
Oct 16 '08 #5
Aye - that's my guess too - if it's varchar(n) the DB won't complain if you
try to stuff n+1000 into it, it'll just truncate (silently) at n when the
data is put into the DB.

"Bob Milutinovic" wrote:
"GTN170777" <GT*******@disc ussions.microso ft.comwrote in message
news:9E******** *************** ***********@mic rosoft.com...
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?

Silly question time... What's the defined size of the VacancyDescript ion
column in the database?

- Bob.
Oct 17 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
12337
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft Access a way of adding records to a access database from a simple web page. I don't want to have to setup ODBC or anything like that I just want to put the web page on the network for anyone to access. Most of the users would use the local access...
38
2295
by: MLH | last post by:
I have 2 global constants declared in the same global module: Global Const MY_VERSION$ = "1.04" Global Const ProjectName$ = "MyProj" I have 2 global procedures designed to return the value of these 2 constants... Function GetCurrentRev() As String GetCurrentRev = MY_VERSION$ End Function
2
2594
by: ChucRock | last post by:
Hi, I have the following code where there is some client side VBScript that does something and needs to pass a variable back to the ASP.NET page. When the page is updated through a postback, the information is lost. What am I doing wrong? After obtaining the variable, I assign it back to a Label text field on the form, it shows up on the web page no problem.
8
3812
by: Michael SL | last post by:
I have been looking in the newsgroup but cannot find what I need. I am using Visual Studio to to build a VB.Net application using System.Web.UI.Page NOT windows.forms. The server fills a textbox and sends it to the client. Initially I wanted to print the textbox but after viewing the complexity it was decided we did not want to spend that amount of time on this. Now the desire is for the client clicking a "button" to have the contents of the...
7
3086
by: Itar | last post by:
I'm having a problem supressing characters in a text box. I only want alpha numeric characters (no special chars). I can handle the TextBox_KeyPress event to supress the invalid characters when the user types them in, however that doesn't handle the user pasting invalid characters. I thought to use the MouseDown event but I couldn't figure out how to tell if the user is trying to paste or is copying the text. To paste the text the user...
7
11639
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
2
2703
by: alivip | last post by:
when I wont to inser (anyting I print) to the textbox it will not inser it just print then hanging # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, # ctrl+v to paste, and ctrl+/ to select all # count words in a text and show the first ten items # by decreasing frequency
6
3325
by: Flyzone | last post by:
Hello, i'm trying to paste copied text from word into an input box. This text is saved into a oracle db and then used as text in another javascript. The problem is that using the saved text (encoded and decoded in the db to avoid sql injection) have some special char that block the javascript execution (i think is unicode char). So i would like to detect and delete this char with a javascript function (i can't disable copy and paste),...
3
5716
by: =?iso-8859-1?Q?Johnny_J=F6rgensen?= | last post by:
I've got a textbox where I filter the input in the KeyPress event to allow only certain characters. However, If the user cuts and pastes a text into the textbox, all text is entered - not only the characters allowed. That doesn't surprise me, but what is the best way of avoiding that and still only allowing certain characters even when pasting??? TIA, Johnny J.
0
9583
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6668
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3560
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.