Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How do I clear an image without clearing a whole form?

Avatar

Avatar
Level 1
renderm47756841
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
renderm47756841
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
renderm47756841
Level 1

12-09-2017

I have a template made up that is strictly for adding photos and a little write up about them. I know the reset button will clear all the images but my issue is if a photo is added to a image field and they want to delete it out they can only reset the whole form or just add a blank photo. I know nothing about scripts but I did see something where if you held down shift  and clicked the picture it would go away??? PLEASE HELP!!

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

13-09-2017

Easy. Create a button for removing the image

Give the click event for the button the code below:

ImageField1.rawValue = null;

Here is another tip in case you want to reset the form but keep the images.

Create a Reset Button and give the click event the code below:

//this code stores the image in a variable, resets the form and puts it back. Effectively not resetting the imagefield
var img; //create variable
img = ImageField1.rawValue; //give the variable the image that is in the ImageField

xfa.host.resetData(); //reset the form

ImageField1.rawValue = img; //restore the image field to the value(image) held in the variable.

1298434_pastedImage_1.png