check whether a text field contains text other than the default entry

Posted on 2012-08-22
Last Modified: 2012-08-24
Dear Experts:

below java script resets the text field (Config.Remarks)to its default value ('Please enter your own text') asking the user beforehand if he/she really wants to do this.

The script works just fine. I wonder whether the java script could be expanded by checking first whether text has already been entered and if not a MsgBox has to tell that no individual text has been entered so far. In the latter case the scripting has to be exited.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas

var cMessage = "Would you like to delete your remarks completely?";

var cMyTitle = "Deletion of the Text Field 'Remarks'";

// Display Alert Box with Question Icon
// Normally the question icon is used in conjunction with the
// Yes/No Button, which returns 3(No) or 4(Yes)
var nRtn = app.alert({cMsg:cMessage, cTitle:cMyTitle,
nIcon:2, // Question Icon
nType:2 // Yes/No Buttons

if(nRtn == 4)
{// Yes Selected - Continue Process
// Place Yes Code Here
Question by:AndreasHermle
    LVL 4

    Accepted Solution

    Test a value of the field. Display the dialog box only if it is different from 'Please enter your own text'.

    Author Closing Comment

    ok, that's it. Thank you very much for your help.

    Regards, Andreas

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe INTRODUCTION This Article is a follow-up to the Article entitled How To Rename-Move a Batch of PDF Files Based o…
    This article is in response to a question here ( at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
    In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
    Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now