Enforce No of Characters using Jscript

Hi

I need a solution to what may seem like a simple bit of Jscript. We would 
like to enforce that our staff insert a minimum number of characters in a 
certain field.

I assume my script would look like:
if (crmForm.all.new_description.DataValue >50)
alert ('Please insert a sufficient description')

The alert works well. I just need to know how to enforce the minimum number 
of 50 characters for the field. Guess there is a bit of Jscript for 
(Characters) that I am missing.

Please assist

Many Thanks
Mark
0
7/23/2008 9:58:01 AM
crm 35858 articles. 1 followers. Follow

2 Replies
640 Views

Similar Articles

[PageSpeed] 51

Use .length attribute to get the length of the text:

if (crmForm.all.new_description.DataValue.length < 50)
{
    alert ('Please insert a sufficient description');
}


-- 
Dejan Dular

http://a-crm.blogspot.com



"Mark Braithwaite" <MarkBraithwaite@discussions.microsoft.com> wrote in 
message news:419E7558-E066-438B-A262-5525469BEB98@microsoft.com...
> Hi
>
> I need a solution to what may seem like a simple bit of Jscript. We would
> like to enforce that our staff insert a minimum number of characters in a
> certain field.
>
> I assume my script would look like:
> if (crmForm.all.new_description.DataValue >50)
> alert ('Please insert a sufficient description')
>
> The alert works well. I just need to know how to enforce the minimum 
> number
> of 50 characters for the field. Guess there is a bit of Jscript for
> (Characters) that I am missing.
>
> Please assist
>
> Many Thanks
> Mark 


0
7/23/2008 10:19:33 AM
Hi

Thanks so much. Works perfectly.

Thanks again
Mark

"Dejan Dular" wrote:

> Use .length attribute to get the length of the text:
> 
> if (crmForm.all.new_description.DataValue.length < 50)
> {
>     alert ('Please insert a sufficient description');
> }
> 
> 
> -- 
> Dejan Dular
> 
> http://a-crm.blogspot.com
> 
> 
> 
> "Mark Braithwaite" <MarkBraithwaite@discussions.microsoft.com> wrote in 
> message news:419E7558-E066-438B-A262-5525469BEB98@microsoft.com...
> > Hi
> >
> > I need a solution to what may seem like a simple bit of Jscript. We would
> > like to enforce that our staff insert a minimum number of characters in a
> > certain field.
> >
> > I assume my script would look like:
> > if (crmForm.all.new_description.DataValue >50)
> > alert ('Please insert a sufficient description')
> >
> > The alert works well. I just need to know how to enforce the minimum 
> > number
> > of 50 characters for the field. Guess there is a bit of Jscript for
> > (Characters) that I am missing.
> >
> > Please assist
> >
> > Many Thanks
> > Mark 
> 
> 
> 
0
7/23/2008 10:31:01 AM
Reply:

Similar Artilces:

Help with tracking user without enforcing security
I know that the best way to track who is in the db is to enforce security. However, I am in a situation where the client does not want the security to be enforced at least right now. since we will have to keep another file (.mdw) on the network. Is there a way to track few users (5 max) in access through code? I have a login form that has 2 text boxes, one for the user ID and the other for the password. I have a table called tblUserLog that every time a user logsin, a new record is created in that table keeping the login ID and date/time. The login form fires the code in the after updat...

very weird characters appearing
I am getting fields populated with very weird characters like: 눭욧㿱 These are text fields and I change them back to what they should be & then they appear again. It's driving me crazy!!! -- Always grateful for help!! At times like this, nothing beats a good backup. In fact make a complete backup of your database now and put it away for safe keeping. Tony Toews has an excellent web page on database corruption. http://www.granite.ab.ca/access/corruptmdbs.htm Allen Brown also has excellent info on corruption. http://allenbrowne.com/ser-47.html I have a white paper in a Word docum...

Using ^F (Find) in the VS
Having long exposure to *NIX systems and tools, I think there's a language barrier between me and the Find Dialog in the Visual Studio. I wanted to search for an occurrence of an equal sign followed by a tab-character in the current file. If this were, say, the nedit-editor in Linux, I'd check the "regular expression" box in the dialog and search for the string '=\t' (without single quotes). Doing this in VS finds nothing. searching for a tab with '\t' just finds the occurrence of the 't' characters. That's not what wanted. I tried to enter a ...

Some address lists may be missing when you use Outlook 2003 in Cac
http://support.microsoft.com/kb/836723/en-us The above MS article mentions Outlook 2003 SP1 fixes the issue with regards to some address lists missing when you use Outlook 2003 in Cached Exchange Mode; Problem is we're already running the recommended Service Pack and we still have the problem. Any ideas? Thanks Brett Have you checked permissions on the address list to make sure that people have the rights to view them? Nue "Bretto" <Bretto@discussions.microsoft.com> wrote in message news:CBC220AA-F13F-474F-B21D-328DB1DD78E1@microsoft.com... > http://support.m...

Which CD Keys have I used?
I have the Student version of Office, which allows me to install on three machines via 3 unique cd codes. I have already installed on 2 machines (a few months ago) and am now adding a third, but I don't recall which cd codes I've already used. The machines will be networked, so I need to get it right. Is there any way to figure out which codes I used? A previous thread ("Matching Office ID to certifiacte of authenticity") from a few weeks ago seems to say no, but I'm not sure it is talking about the same issue. Thanks for any guidance. In article <C030F408.529F%...

Convert Number Field to Date using query
I have search the forum and found several people asking this question, but my situation is a little different. I have a database that I need to convert a number field to a date, but the number fields have the date as "08/07/2007". I have not been able to find a way to convert this number field to a date. Any suggestion/comments would be greatly appreciated! Thanks You sure it's a numeric field? Numeric fields wouldn't have slashes in them. If it's text, you can use the CDate function. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please...

Update attribute using ldp
Hi There, I have written an ldf script which creates few custom attributes and an auxilliary class which contains these custom attributes. Also this auxilliary class is part of Users and OrganizationalUnit classes. Now I want to update the values to the custom attributes. How do I do it using ldp? I can set values for the inbuilt attrbutes without any issues, however when I try to set the values for the custom attributes I get below error, Error 0x20B5 The name reference is invalid. Please advise. Thanks, Suresh -- sureshpalani ----------------------------...

Using User input in excel VBA
I'm supposed to make an invoice of 4 items. Each item needs to have user input for the description, price, and quantity ordered. Then I need to calculate the cost of the 4 items. Then calculate the sales tax at 6%. Then calculate the total cost including sales tax. This needs to be done using VBA code in excel. --I'm curious as to how to prompt the user to give me information. --I'm curious as to how I would use the users input in another cell once they entered it. -- I'm curious also as to how VB will know that something is entered once the user enters something into t...

Enforce No of Characters using Jscript
Hi I need a solution to what may seem like a simple bit of Jscript. We would like to enforce that our staff insert a minimum number of characters in a certain field. I assume my script would look like: if (crmForm.all.new_description.DataValue >50) alert ('Please insert a sufficient description') The alert works well. I just need to know how to enforce the minimum number of 50 characters for the field. Guess there is a bit of Jscript for (Characters) that I am missing. Please assist Many Thanks Mark Use .length attribute to get the length of the text: if (crmForm.all.new_...

Which loop to use
Here is my question. I have a user form with 12 textboxes, each named textbox1-textbox12. I want the data to go from the user form to a sheet. I try to make the process quicker by using a for loop. For example: For k=1 to 12 j=k+1 ActiveCell.Offset(k,0).Value = TextBoxj.value 'Here is where error is highlighted Next k However, everytime I try this I get the same error saying "Object required". The only way I can get this to work is by individualy giving the value of the cell the value of the textbox, for example: ActiveCell.Offset(1,0).Value = TextBox2.value 'I do thi...

What is the TS40202 used for?
Can anyone tell me about the TS40202 table? I have some consistency errors in my database and I have identified the tables that seem to have issues. What module is this table used for? What type of data is housed in the table? It looks like it has to do with "timesheets", but I am not sure if that is a HR, Payroll, Project Accounting, or some other table. I have not had any luck finding it under TOOLS > RESOURCE DESCRIPTIONS > TABLES. Thanks! Lets start with a few questions: 1) what third-party apps are you using? 2) Are you using Business Portal or PDK? Given the ...

Max number of characters in a cell
Is it possible to have more than 1024 characters in a cell? I have tried to use char(10) and char(13) however while the formula allows me to copy and paste more than 1024 characters it limits my statements to 100 characters after 1024. Is there any way to go around this and be able to have as many characters as one wish in a cell. Thanks You might search on "limits" in Excel help for this and other limits. A cell can hold a text entry of a max of 32k characters. A formula can have about 1000 characters. -- Jim "Dajana" <Dajana@discussions.microsoft.com>...

Enforce format
How can I "enforce" a format in a cell in excel so that it allows number entry only, i.e. it does not allow letters or any other characters. Thanks in advance. Keith Data Validation; custom formula; If active cell is A1, use this: =NOT(ISERROR(1*A1)) "Elfey1001" <Elfey1001@discussions.microsoft.com> wrote in message news:D744EEFC-3BD0-43A7-B673-F16107BBFA03@microsoft.com... > How can I "enforce" a format in a cell in excel so that it allows number > entry only, i.e. it does not allow letters or any other characters. > Thanks in advance. > Kei...

using template
I am using VC6 in Windows 2000. I got a template library. A function of the library has a templated class as its argument. The source of the library is structured like: In .h file: template <class T> class SomeArray; // forward declaration template <class T> void ResizeArray(SomArray<T>&a, int n); // specialization of the function for Point type template <> void ResizeArray(SomeArray<Point>& a, int n); template <class T> class SomeArray { friend void ResizeArray(SomeArray<T>&, int); }; The definition of the specialization is implem...

Making Characters from Character Viewer More Easily Available
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I'm writing a manual where I need to often use both the Place of Interest Sign that denotes the Command key, as well as the Upwards White Arrow that typically means the Shift key, and I'm getting those from the Character Viewer, thanks to information from this forum. I'm wondering, however, if there is a way to make those characters available more readily, so that I might insert them with specially designated keystroke combinations, as you can with the symbols in Word? I'm using them enough now...

HTML Emails Not Using Default Font
I'm using O2003. I have all my fonts composing, reading, replying/forwarding to be Tahoma 10. Sometimes when I get a message and reply, it defaults to Times New Roman 10. I then need to change it back to Tahoma. Can I change this so it always defaults to Tahoma 10 all the time. In the past I didn't think this could be done, but wanted to ask if maybe it was now possible. Thank you. Shawn ...

Make and use Invoices with Excel
Where would I find step-by-step insrtuctions on making invoices using the invoice template in Excel? Is there something specific you're having troubles with -- Message posted from http://www.ExcelForum.com Yes, I don't understand the process... I can modify the template and fill it in but don't know how to generate the 2nd invoice. Thanks for any help. Harry >-----Original Message----- >Is there something specific you're having troubles with ? > > >--- >Message posted from http://www.ExcelForum.com/ > >. > I am also having trouble linking t...

Charting using ADO data fail unless on localhost computer
Charting Gurus!, A few tough questions that need answers asap! Be a hero! 1. When querying http://localhost a chart is successfully shown populated with ADO data like so: StrOpen = "Provider=MSDASQL.1;Persist Security Info=False;Mode=Read;Extended Properties=" & chr(34) & _ "DSN=crstats;DBQ=D:\Inetpub\wwwroot\crstats;DefaultDir=D:\Inetpub\wwwroot\cr stats;DriverId=27;FIL=text;MaxBufferSize=2048;PageTimeout=5;" & chr(34) & ";PASSWORD=;" ADOConnection1.Open strOpen Question; HOWEVER when using a remote IE client i.e. http://somename sam...

Is there any way to use longer strings in formulas?
In Excel 2002, the longest string I can use in a formula is (to my mind) ludicrously short. I have a workbook that requires HUNDREDS of English sentences like: ="Just to let y'all know, thanks to all the swell work by our sales staff in 2007, and despite our having to fire half of them for insubordination, and despite our chairman's having run off to a region in Asia which we believe is officially called the Glorious Former Soviet Autonomous People's Provisional Revolutionary Socialist Republic of Trans-Caucasian Equitorial Guinea, our company's annual return on investme...

>Anyone using SQL server cluster?
Is anyone is using a clustered SQL Server for Microsoft CRM 1.2 ? (in deployments with no Sales for Outlook clients) . Please share your experience with the group OR if you do not wish to post a reply here ; ) due to risk of invalidating support with MS - please email me at peter DOT lynch AT optevia DOT com I believe a clustered CRM database works just fine in deployments with browser clients only. Thanks in advance! Peter I know of at least one client using clustered sql so there are companies doing it however I do not have a contact there. -- John O'Donnell Microsoft CRM ...

Using message to create an address list
I have sent an email to 100 people and 25 of them have replied to say they're interested in whatever it is. So I have a folder in Outlook with all their replies in it. I want to send a message to all of them. How do I get their addresses in to a list or create a mail message with all their addresses in it? Diane <anonymous@discussions.microsoft.com> wrote: > I have sent an email to 100 people and 25 of them have > replied to say they're interested in whatever it is. So > I have a folder in Outlook with all their replies in it. > I want to send a message to ...

count number of characters in rich edit control
How can i count number of characters in rich edit control 2 If u mean controls of type Rich TextBox control, try RichControl1 RC1; CString Mes=RC.GetText(); int n=Mes.GetLength(); "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i count number of characters in rich edit control 2 EM_GETTEXTLENGTHEX, WM_GETTEXTLENGTH, WM_GETTEXT, EM_STREAM* "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i co...

OT: What tax software is everyone using this year?
TurboTax is too expensive ($40 + electronic filing fees), TaxCut is $30 and included filing fees, TaxAct is $20 for the same thing. Do Money 2006 Deluxe owners get any special offers on Taxcut? -- Aloke ---- to reply by e-mail remove 123 and change invalid to com Excel. I'll probably use the Quicken free efile and then put my own data in the free state online system. "Aloke Prasad" <aprasad123@columbus.rr.invalid> wrote in message news:esnx6uG$FHA.3564@TK2MSFTNGP10.phx.gbl... > TurboTax is too expensive ($40 + electronic filing fees), TaxCut is $30 > and i...

Using a sub procedure to change a subform property
I am currently using the following code to change the AllowEdits property on any form. The form calls the Sub procedure through a button's OnClick event. Sub UnlockForm(strFormName As String) On Error GoTo Err_unlockform If Forms(strFormName).AllowEdits = False Then Forms(strFormName).AllowEdits = True MsgBox "Form is now unlocked for editing." End If Exit_unlockform: Exit Sub Err_unlockform: MsgBox Err.Description Resume Exit_unlockform End Sub I am trying to call this Sub procedure from a button on a subform. I was going to us...

Enforce Passwor Policy
Bonjour! I'm wondering when we create a user in GP, the 2 settings (Enforce Passowrd Policies, Enforce Password expires) that are in the Advanced Option, are related to Active Directory Group policy? Because in SQL we can't modify those settings. It is for our auditors to explain. Regards, Joel :) Hi Joe Yes, the configuration of the these two settings comes from the Goup policy domain setting. So if you your windows password expires every 90 days, your SQL acount password will as well. Just remember the two accounts are not tied to each other in anyway, so your w...