Previous | Next | (P-PDF) JavaScript
Topic: Re: Number of Lines In Field
Conf: (P-PDF) JavaScript, Msg: 28583
From: J-Me
Date: 10/16/2001 06:06 AM
Thank you for your reply. I have a follow-up question. I've been trying to find a way to search for the newline (\r) character, but I'm finding very little help on the web. I've written a little algarithm to go through the text field and search for it, but I'm not sure of the syntax.
When you click the submit button for the entire page, this script is called:
var colField = this.getField("fieldToBeSearched").value;
Validate(colField);
Which calls the Validate function:
function Validate(colField)
{
for (var x=0; x<colField.length;x++)
{
if (colField.substr(x,2)== '\r') {
app."Okay");
}
}
}
But I'm not sure if I should be searching for one character or two equal to \r, and what the syntax should be for the if clause [(colField.substr(x,2)== '\r') or (colField.substr(x,1)== '\r') or (colField.substr(x,2)== (\r)) etc..]. Any help is greatly appreciated.