• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

If conditions and counting interactions

Community Beginner ,
Nov 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

Hi,

I'm a complete novice when it comes to HTML5 actions and I'd really like some help trying to figure out a very specific issue if you would?

I have 12 squares (buttons), each button pulls a single random answer from a pot of 12. Each time a single button is selected and the answer is shown the button disappears. So far I have all this working.

The next step is that I want the user to only be able to choose 3 of the 12 buttons - any three, entirely at random and when the 3 have been selected the rest become inactive.

Any help you can provide would really help me,

Thanks,

Aidan

Views

147

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Nov 17, 2017 Nov 17, 2017

Hi,

Thanks for your reply, I was having difficulty disabling the other 9 buttons that hadn't been pressed because we can't determine which of the 12 buttons a user will choose 3 of.

However I managed to resolve this all now, my if conditionals weren't working correctly. I'm not sure my solution is the neatest or most efficient but it works.

Thanks again,

Votes

Translate

Translate
LEGEND ,
Nov 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

What exactly are you having difficulty with? Maintaining a variable that's incremented by 1 every time the user clicks a button, or disabling buttons that haven't been clicked?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2017 Nov 17, 2017

Copy link to clipboard

Copied

LATEST

Hi,

Thanks for your reply, I was having difficulty disabling the other 9 buttons that hadn't been pressed because we can't determine which of the 12 buttons a user will choose 3 of.

However I managed to resolve this all now, my if conditionals weren't working correctly. I'm not sure my solution is the neatest or most efficient but it works.

Thanks again,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines