Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

How do I alter this Javascript code to make an exception for a read-only command?

$
0
0

Hello,


I posted a question earlier in another subforum and found this script that makes form fields read-only. Now I have a coding question specifically.


First, here is the code:

 

 

var r = app.alert("Are you ready to lock this document?",2,2);
if(r ==4){// 4 is Yes, 3 is No
  
for(var i =0; i <this.numFields; i++){
  
var fname =this.getNthFieldName(i);
  
this.getField(fname).readonly=true;// makes all fields readonly
  
}
}

 

 

On the bottom of my form, I have a button that allows a user to make the form read-only, but I also have other buttons such as "print." How do I alter the code above to make an exception to the read-only command for my buttons so that they're still functionable at the bottom of my form? I know nothing regarding Javascript so this is a foreign language to me.

 

Any help is appreciated!


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>