Character / photo variable

Tommy Park shared this problem 5 years ago
Solved

I have two question.


------------------------------------------------------------------------------------------


FIRST QUESTION


I have a forum which the user is suppose to fill out.


HOWEVER, I do not want them to proceed to the next page unless they fill the forum out.


is there any way to set a condition where if they type in any character, they can proceed?


For Example:


[Name _________________] // I have a variable for when On Change the variable "Name" fills with whatever the user types in.


If I set When { [Name _________________] = "Name"} Do {next page}


the problem is when they don't type anything it will still proceed.


another idea is:


When( "Name" = {a}or{b}or{c}or{d}...} ect Do { next page}


When( NOT{a}or{b}or{c}or{d}...} ect Do { error message}


Im lost on this one.


------------------------------------------------------------------------------------------


SECOND QUESTION.


I have three photo the user can choose from to be their profile picture.


I would like them to select only one to proceed to the next page.


This one photo they select will appear on their profile page.


I used the variable counter = 0


set each photo as Set Value: Counter + 1


When {counter = 1} do {next page}


When {counter 1} do {error Message}


HOWEVER. The problem with this is.


If they want to deselect a photo...im not sure how to do this.


ALSO


Assigning whichever photo they choose to be the variable "Profile Picture"


So I can use this variable anywhere for other pages.

Comments (4)

photo
1

when{counter>1} or {counter<1} do { error mesage} *****

photo
1

For the first question, please take a look at this other thread: https://www.justinmind.com/community...


As for the second question, I'm afraid I'll need more details about what you want to do. Can you describe what the user should do to deselect an image in your real application?

photo
1

So the user enters this page.


The page asks them to select one of the 3 images.


When a user clicks on an image, the borders of this image changes style. (higher stroke) then the user can press the "next button" to proceed to the next page.


The user can not proceed unless they choose on of the following 3 images.


-I want the user to be able to deselect an image after they have already


selected it through clicking.


- Also I want this image the user selects to be a their avatar. Which should be


able to be done through variables right?

photo
1

-I want the user to be able to deselect an image after they have already


selected it through clicking.


-> You can use a dynamic panel for each image. In one panel, you have the image and on another panel, the same image but selected. Then you just need to set the right events (the one to change from one panel to the other and the ones to add or remove from the variable 'counter' you have.


- As for the image, there are two ways to do it. One is to store in a variable some identifier so in the next screen you know what image have been selected. Then, in that screen, you just need to have all the images and show the one identified by the variable.


The other way is a trick. You can't set a variable's value as one of the images in your screen. But, in fact, there is a way. First define this kind of event on a label, let's call the label Label_1:


on click Label_1 -> set value -> Label_1 -> Value is -> (calculated) -> drag Label_1 to the expression.


Once you have that event, use the events broom tool to copy that event from the label to the image. The references to Label_1 will be changed to the image. Then you just need to edit the event and, instead of setting the value in the image, select the variable you want.