Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8308479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:49:36+00:00 2026-06-08T18:49:36+00:00

Here is the code I am having trouble with everyone. This is what I

  • 0

Here is the code I am having trouble with everyone. This is what I have been working on for 8 hours since I do not know js. I got most of this from the w3school.com site and just have been trying to piece everything together. ugh please help

<script type="text/javascript">
var stringToMatch = 'christopher',  
input = document.getElementById('text'),  
div = document.getElementById('divColor1');  

 function toggle (switchElement){  
 if (this.value == stringToMatch){  
    div.style.display = 'block';  
}  
else {  
    div.style.display = 'none';  
}  
};?  
 </script>


 <!--This is the start of the code which i want to appear--> 
 <h3>Coupon Redeem</h3> 
 <form action="test" method="post"> 
Please type in the Coupon Code you have recieved: 
 <form id='coupon' onChange="javascript: ShowMenu(document.getElementById('text').value,'divColor1');">  
<input id="text" type="text"> 
<input type="button" id="text" value="Redeem" onClick="toggle(this)" /> 
</form>
 <!--This is the start of the hidden field that i want to appear when the coupon code is entered     correctly--> 
<div id="divColor1" style="display:none;"> 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_s-xclick"> 
<input type="hidden" name="hosted_button_id" value="asjsanxci"> 

  <input type="hidden" name="on0" value="Tokens">Tokens 
    <select name="os0"> 
  <o ption value="5 tokens">5 tokens$5.00 USD</option> 
 <option value="10 tokens">10 tokens$10.00 USD</option> 
 <option value="15 tokens">15 tokens$13.00 USD</option> 
 <option value="20 tokens">20 tokens$18.00 USD</option> 
 <option value="25 tokens">25 tokens$23.00 USD</option> 
 <option value="30 tokens">30 tokens$27.00 USD</option> 
 <option value="35 tokens">35 tokens$33.00 USD</option> 
 <option value="40 tokens">40 tokens$38.00 USD</option> 
  <option value="50 tokens">50 tokens$45.00 USD</option> 
 </select>  
&nbsp;&nbsp;&nbsp;&nbsp; 
<input type="hidden" name="on1" value="Username Verification">Username Verification 
 <input type="text" name="os1" maxlength="200"> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<input type="hidden" name="currency_code" value="USD"> 
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
</form> 
</div> 

<br> 
</form> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:49:38+00:00Added an answer on June 8, 2026 at 6:49 pm

    your code has a syntax error

    <div id="divColor1" style="displayed:none"
    

    change that to

    <div id="divColor1" style="display:none;">
    

    also some other bugs that i found

    <form id='coupon' onChange="javascript: ShowMenu(document.getElementById('text').var,'divColor1',);">
    

    your ShowMenu is missing a variable, and another syntax error document.getElementById(‘text’).var

    >

    <form id='coupon' 
        onChange="javascript: ShowMenu(document.getElementById('text').value,'divColor1');">
    

    Update
    I have made some changes to your code. you can see the working code here

    Updated code

    <script>
    var stringToMatch = 'christopher';  
    function toggle (){  
     var input = document.getElementById('text').value; 
    
     if (input == stringToMatch){ 
        document.getElementById('divColor1').style.display = 'block';  
    }  
    else {  
       document.getElementById('divColor1').style.display = 'none';  
    }  
    };​
    </script>
    
     <!--This is the start of the code which i want to appear--> 
     <h3>Coupon Redeem</h3> 
     <form action="test" method="post"> 
    Please type in the Coupon Code you have recieved: 
     <form id='coupon' onChange="javascript: ShowMenu(document.getElementById('text').value,'divColor1');">  
    <input id="text" type="text"> 
    <input type="button" id="text" value="Redeem" onClick="toggle()" /> 
    </form>
     <!--This is the start of the hidden field that i want to appear when the coupon code is entered     correctly--> 
    <div id="divColor1" style="display:none;"> 
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
    <input type="hidden" name="cmd" value="_s-xclick"> 
    <input type="hidden" name="hosted_button_id" value="asjsanxci"> 
    
      <input type="hidden" name="on0" value="Tokens">Tokens 
        <select name="os0"> 
      <o ption value="5 tokens">5 tokens$5.00 USD</option> 
     <option value="10 tokens">10 tokens$10.00 USD</option> 
     <option value="15 tokens">15 tokens$13.00 USD</option> 
     <option value="20 tokens">20 tokens$18.00 USD</option> 
     <option value="25 tokens">25 tokens$23.00 USD</option> 
     <option value="30 tokens">30 tokens$27.00 USD</option> 
     <option value="35 tokens">35 tokens$33.00 USD</option> 
     <option value="40 tokens">40 tokens$38.00 USD</option> 
      <option value="50 tokens">50 tokens$45.00 USD</option> 
     </select>  
    &nbsp;&nbsp;&nbsp;&nbsp; 
    <input type="hidden" name="on1" value="Username Verification">Username Verification 
     <input type="text" name="os1" maxlength="200"> 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <input type="hidden" name="currency_code" value="USD"> 
    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
    </form> 
    </div> 
    
    <br> 
    </form> ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble getting this invisibilityOfElementLocated() method to work. Here is the code
I'm having some trouble with the jQuery hover method. Here's the relevant JavaScript code:
See here for code: http://jsfiddle.net/ecFBK/10/ I'm having a hard time getting this to work
I'm writing some code here, and I'm having a had time. I have a
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
Here's the code I'm having trouble with. I'm using an EDMX modeled from an
I am having trouble updating a jlabel in a method. here is my code:
I'm having trouble getting Jquery .closest() to work. Here's my code, it's simple and
I am having trouble getting the bulk uploader to work. I have been following
I'm having trouble understanding how QGraphicsItemAnimation's setScaleAt function works. Here's the code I'm using:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.