[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

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

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
resetForm(["Config.Remarks"]);
}
0
Andreas Hermle
Asked:
Andreas Hermle
1 Solution
 
NetExpert_plCommented:
Test a value of the field. Display the dialog box only if it is different from 'Please enter your own text'.
0
 
Andreas HermleTeam leaderAuthor Commented:
ok, that's it. Thank you very much for your help.

Regards, Andreas
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now