cancel
Showing results for 
Search instead for 
Did you mean: 

Delete empty space and replace next field value in adobe form

uirji_netweaver
Participant

Hi Team,

i need to print the address in adobe form like below

Text1 , Text2, Text4<br>Text5<br>Text6 Text7 Text8<br>Text9.

Incase Text 1 and Text5 are blank values it should be print asbelow

Text2, Text4<br>Text6 Text7 Text8<br>Text 9.

i used the below script in form:ready , and also maintained subform content as flowed but it is still not printing the blank space, please help me with wrire procedure

if ((this.rawvalue == null) || (this.rawvalue == "")) {<br>this.presence = "hidden" } 

Thanks

NK

Sandra_Rossi
Active Contributor

I'm copying the question better formatted + one comment from the OP, to clarify the question, that will help anyone who visits the question now:

Question:

"i need to print the address in adobe form like below"

Text1 Text2 Text4
Text5
Text6 Text7 Text8
Text9

"In case Text1 and Text5 are blank values it should be print as below"

Text2 Text4
Text6 Text7 Text8
Text 9

i used the below script in form:ready , and also maintained subform content as flowed but it is still not printing the blank space, please help me with wrire procedure

if ((this.rawvalue == null) || (this.rawvalue == "")) {<br>this.presence = "hidden" } 

Comment:

"i want delete empty space and replace it with next field value."

"here Text1 is blank , so Text2 should print from the place where Text1 is started, Text5 is blank so the next row (Text6 Text7 Text8) should come up and print as below"

([ed.] also Text5 is blank)

View Entire Topic
BEKOStan
Active Participant

Hi uirji.netweaver ,

I created a simple template for demonstration purposes.

Is this the desired layout? (yellow marked fields will be NULL later on)

A preview would generate the following:

then I added a script on each Textfield, if there is no data, it should set the presence to hidden. I created a second preview data xml, where text1 (=10) is empty and also text4 (=40).

As a result I get the following:

But I think you want to have something like the following layout (see the subforms namend Line1, Line2, Line3😞

Again, I created an example, where all yellow textfields are NULL and the result would be the following:

(I think, this is what you asked for - at least I interpreted it in your question 😉 )

Maybe there is something included which can help you.

BR

Andreas

uirji_netweaver
Participant

Thanks for your detailed reply, i did everything same as above but still empty value is not deleted and replaced by next field value. but to test i added this. Presence = "hidden"; this works fine, when i add the full script ( on each field), it's not working, please check the below code and let me know if any correction needed.

 if (this.isNull or this.rawValue == "") 
then 
	this.presence = "hidden";
 endif
Thank youNK
BEKOStan
Active Participant
0 Kudos

Hi uirji.netweaver ,

your last comment is not clear to me. you mix not deleted, replaced, presence="hidden",...My script is basically the same as yours:

What you need to do is to test with different Preview XMLs (I created 3 in my post from yesterday, where some fields are empty).If you want, I can attach my template and preview-xmls - just let me know.

Best Regards

Andreas

uirji_netweaver
Participant

i replaced with your code , its works well now . Thanks again for your help.