Skip to main content
Participant
April 26, 2022
Question

Validating Fields in JavaScript

  • April 26, 2022
  • 3 replies
  • 785 views

Hi,

We are trying to hide the text while entering into the text field and show the text after submitting the form. We need to know where we need to add this code

we used the below code

var a=this.getField("cityname") ;
var aValue="";
this.getField("cityname").onkeyup = function() {aaa()};

function aaa()
{
var inputvalue=a.value.substring(a.value.length-1);
if(a.value.length<=15)
aValue+="*";
else
aValue+=inputvalue;
a.value=aValue;
}

This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
Community Expert
April 27, 2022

Are you serious?

😉

 

Acrobate du PDF, InDesigner et Photoshopographe
manikanta_chotu
Participant
April 27, 2022

No Issue sir,
Password :  Rise@123

I can make up the hours over the rest of the week, if that would help. Please let me know at your earliest convenience.


Thank you,

Manikanta

JR Boulay
Community Expert
Community Expert
April 26, 2022

I guess you should use a text field with the "password" option enabled, but...
For obvious security reasons the value of such a field is not exported or saved with the other data.

So before sending the form the script should remove the "password" option from the field concerned, or duplicate its value in another (hidden) field.

Can you share your document or a rougth?

 

Acrobate du PDF, InDesigner et Photoshopographe
manikanta_chotu
Participant
April 27, 2022

I attached form below

JR Boulay
Community Expert
Community Expert
April 26, 2022

This script will overwrite any input made in the "cityname" field, instead of hiding it.

 

This is not part of the ECMAScript language:

this.getField("cityname").onkeyup

 

 

Acrobate du PDF, InDesigner et Photoshopographe
manikanta_chotu
Participant
April 26, 2022

@JR Boulay We want to hide it while entering the text after submit we want to see the text. Can you help us with the coding