Hidden fields in Adobe using Java


hello,

 

i trying write script hide field based off value inserted in field.

 

i have started this:

 

   var show = true;

   if(this.getfield("quantity1").value.length == 0)   show = false;

 

   if(show)   this.getfield("linetotal1").value = display.visible;

   else   this.getfield("linetotal1").display = display.hidden;

 

   event.value = this.getfield("quantity1").value * this.getfield("unitprice1").value;

 

now, when there no value inserted in "quantity1", correct field "linetotal1" hidden.  problem having field staying hidden if go , put value in "quantity1".

 

is there way have loop or if statement correct problem? or there better way action together?

 

thanks in advance,

rod

simplifying bit, try this:

 

// show/hide linetotal1

getfield("linetotal1").display = getfield("quantity1").valueasstring ? display.visible : display.hidden;

 

// calculate field's value

event.value = getfield("quantity1").value * getfield("unitprice1").value;



More discussions in JavaScript


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support