if statement placement for empty responses? also scrolly? #160
Unanswered
annyrviloria
asked this question in
Help Desk
Replies: 1 comment
-
@annyrviloria having an if statement for no responses is correct! i'll provide a better explanation after class today! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! So, our website has three content boxes, each contains buttons with responses to a given question of the survey. We want a scrolly thing inside each box. The first box looks great: buttons and a scrolly:
However, the two other boxes have buttons but not a scrolly, and it's also as long as the content is:
![Screen Shot 2021-05-27 at 10 36 15 AM](https://user-images.githubusercontent.com/72164641/119871540-6368f100-bed7-11eb-99a3-39c80484b02b.png)
I have a feeling this is due to the fact that box 2 and 3 have buttons are are empty and are messing up with the size of the box? It's the only thing in our script that is being picky and I can't think of anything else.
Assuming the issue is the empty boxes I though having an if-statement that would tell my js to only create a button if the survey response wasn't empty:
if(data.authoritiesresponse != ""){ function createButtons2(lat,lng,title){...} }
This broke the website. I tried placing the if statement inside the function and it didn't work either.
Is there a better placement for these if statements so that no buttons are created if response is empty?
Additionally, if this is actually not the cause of our troubles, other ideas for fixing scrolly would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions