Below you will find pages that utilize the taxonomy term “Javascript”
Posts
Fill field with colour on change
Originally published on 2018-05-10
If we need a placeholder text to disappear on the static background.
Actions of the field
OnFocus:fillWhite();
OnBlur: fillTransparent();
textFields(); function textFields() { for (var fieldNumber = 0; fieldNumber < numFields; fieldNumber++) { var aField = getField(getNthFieldName(fieldNumber)); if (aField.type === "text" || aField.type == "combobox") { aField.setAction("OnFocus", "fillWhite();"); aField.setAction("OnBlur", "fillTransparent();"); } } } function fillWhite() { var me = getField(event.target.name); me.fillColor = color.white; } function fillTransparent() { var me = getField(event.
Posts
Custom radio in Acrobat
Originally published on 2018-05-01
Sometimes there is a need for a custom behaviour of radiobutton, such as underline of an option.
function radio() { // Show/hide the field border depending on the state of the check box var myField = this.getField(event.target.name); var ampm = myField.value; switch(ampm) { case 'AM': var am = getField(myField.name + '.0'); var pm = getField(myField.name + '.1'); am.strokeColor = color.black; pm.strokeColor = color.transparent; break; case 'PM' : var am = getField(myField.
Posts
One char fields
Originally published on 2018-05-15
When a collection of fields looks like this if (event.change.length > 0) nextField(); function nextField() { var prefix = "Text"; // length of prefix in field name var nextInd = event.target.name.substr(prefix.length, (event.target.name.length - prefix.length)); var nextName = prefix + (++nextInd); getField(nextName).setFocus(); }