473,796 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need help hiding/ disabling buttons.

Blue1244
39 New Member
Hello, I'm 13 trying my luck with js. I am trying to make an in browser game. It is a simple math game, just basic stuff.I am trying to have a list of buttons on the webpage, but you need to go down in order without being able to pick question two instead of question one. How do i make the other buttons inactive until completion of the first question.

Here is my code:(Not really good)
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <script language="javascript">
  5. alert("Are you sure you want to play this game?");
  6. var Name = prompt("What is your name?");
  7. </script>
  8.  
  9. <script type="text/javascript">
  10. document.write(Name);
  11. </script>
  12.  
  13. <center><button id="button1" onClick="start()">First Question</button></center>
  14.  
  15. <script>
  16. function start() {
  17. var one = prompt("What is 3 * 4 ?");
  18.  
  19. if (one!=12)
  20.   {
  21.    {
  22.  alert("Correct");
  23.   }
  24.  else 
  25.  {
  26.  alert("Incorrect");
  27.  }
  28. }
  29. </script>
  30. </html>
  31.  
Aug 21 '13
23 1554
Blue1244
39 New Member
Thank you for your help.
Aug 22 '13 #21
Blue1244
39 New Member
Oh and one more question how do i run one function from within another function?
Aug 22 '13 #22
Blue1244
39 New Member
Never Mind i don't need an answer.
Aug 22 '13 #23
Dormilich
8,658 Recognized Expert Moderator Expert
Expand|Select|Wrap|Line Numbers
  1. function test1()
  2. {
  3.   // ...
  4. }
  5.  
  6. function test2()
  7. {
  8.   // ...
  9.   test1();
  10.   // ...
  11. }
Aug 22 '13 #24

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3538
by: Philippe Meunier | last post by:
Hi, I am using the .NET toolbar with VB.NET 2003. My toolbar uses icons images that are actually PNG files and uses alpha blending on it. So to make alpha blending work correctly with the Toolbar and the Imagelist I had to use a tricky method with API calls that is described like this by a MS MVP : 1) Use v6 of the common controls (have a manifest) 2) Load the PNG using GDI+
16
2063
by: Ralph Freshour | last post by:
How can I disable a button once it has been clicked? I want to prevent the user from clicking on it twice if they have a slow connection. Thanks...
5
5056
by: Lyn | last post by:
Hi, I hope someone can help. I have a main form which mostly fills the Access window. In the bottom half of this form I have a tab control to display various types of data related to the main form record. In each page of the tab control, there are three buttons: Add, Update, Delete. Any of these buttons will open another, smaller form to add, update or delete the related data record. Originally, I had placed the smaller form such...
2
1382
by: Michael Groeger | last post by:
Hi all, I want to disable a button after it's clicked on the clients side, so that this cannot be clicked twice. I tried this with adding the "onclick" attribute to the button and disable the button then in javascript. Then I tried it using Page.RegisterOnSubmitStatement(), but when I then click the button the Click event is not fired on server side. Any ideas?
1
4393
by: mssbass | last post by:
In order to disable the previous and next buttons on my form, I followed the attached code. The buttons seem to work fine except for one thing. When the form first opens, the next button is disabled; however, if you click on the forward arrow on the scroll bar and click the previous button which takes you back to the 1st form, the next button is now enabled! What am I doing wrong? I just need the next button to be ENABLED when I open...
3
1441
by: hplayer03 | last post by:
I'm having major issues disabling a submit button after a form has been filled out. Nothing I've tried so far has helped. I've put if(!Page.IsPostBack) { Session=false; } else if((bool)Session==true) { contiuneCode();
0
946
by: andymcintosh85 | last post by:
Hi, I have designed a macro which prints out the first 2 pages of a word document. The Macro is assigned to a command button which is at the bottom of the second page. At the moment, the macro works fine, but the command button is being shown on the print out too. How can i adopt hiding the command button into my vb code? Many thanks Andrew
9
7148
by: poml | last post by:
Hello, first time posting on thescripts.com, and I'm in dire need of some help. All I want to do is disable the submit button (not the entire form) onClick, and am wondering if this is possible. Here's the current coding: <form enctype="multipart/form-data" action="?id=completeupload" name="submitform" method="POST"> <b>File to Upload:</b>&nbsp;<input name="userfile" size="50" type="file"><br><br> <span class="class3"> <input...
1
2573
by: sirdevo | last post by:
There is one combobox on a subform named Report Soil Series Subform1. The combobox is named cboSoilSeries. I need to disable this so the user can't enter values. I could also disable the whole subform since this is the only control on the subform. I've tried this line of code but it says you can't disable the control while it has focus. Forms!!.Form.cboSoilSeries.Enabled = False The combobox does not have focus when I run that line of...
4
2622
by: Pabicoch | last post by:
Ok so I'm trying to move items from one listbox to another by using multiple buttons i.e I have 2 buttons cmdRight and cmdRight2 which are both disabled on form load If the user selects a single item on the first listbox a cmdRIght button enables but cmdRight2 is still disabled , if the user selects multiple items on the first listbox a cmdRight2 button enables but cmdRight is disabled. I've got the move buttons to work but the problem...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10169
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.