[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Clear entered text in a text field in one go using a button

Posted on 2012-08-22
3
Medium Priority
?
408 Views
Last Modified: 2012-08-23
Dear Experts:

A fillable form has a textfield where the user can enter free text (multiline text).

A button that is placed next to text field ...
... should enable the user to clear the whole text - he/she has just entered - in one go ... and
... the default text 'Please enter remarks here' has to re-appear.

Is this possible using Java Scripting.

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

Regards, Andreas
0
Comment
Question by:AndreasHermle
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
captain earned 2000 total points
ID: 38320657
Hi

In the simplest form this does not have to carry out an action 'reset' but simply change whatever text is in the field to a text of your choosing.

For this you use java script action on a button.

let's assume you have specified the Field 'Text1' and you have the button next to it, you use the following script to change the value when the button is pressed:

{
  getField("Text1").value = 'Please enter remarks here';
}

Open in new window


hth
capt.
0
 

Author Closing Comment

by:AndreasHermle
ID: 38323900
Hi capt.

Thank you very much for your professional help. It works fine.

Regards, Andreas
0
 
LVL 31

Expert Comment

by:captain
ID: 38324184
Great. Glad it helped. :)

Thanks for the accept.
capt.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
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…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
Suggested Courses
Course of the Month19 days, 14 hours left to enroll

873 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