473,545 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accordion Form help

nomad
664 Recognized Expert Contributor
Hello everyone:

I need some help with the form Accordion

It will not close not sure how to solve it any help would be great. Should I be using dl dt ?

Note when you click the arrow button the form info will not close.

Here is my code.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>Accordion 1</title>
  6.  
  7. <script type="text/javascript" src="jquery.js"></script>
  8.  
  9. <script type="text/javascript">
  10. $(document).ready(function(){
  11.  
  12.     $(".accordion h3:first").addClass("active");
  13.     $(".accordion p:not(:first)").hide();
  14.  
  15.     $(".accordion h3").click(function(){
  16.         $(this).next("p").slideToggle("slow")
  17.         .siblings("p:visible").slideUp("slow");
  18.         $(this).toggleClass("active");
  19.         $(this).siblings("h3").removeClass("active");
  20.     });
  21.  
  22. });
  23. </script>
  24.  
  25. <style type="text/css">
  26. body {
  27.     margin: 10px auto;
  28.     width: 570px;
  29.     font: 75%/120% Arial, Helvetica, sans-serif;
  30. }
  31. .accordion {
  32.     width: 400px;
  33.     border-bottom: solid 1px #c4c4c4;
  34. }
  35. .accordion h3 {
  36.     background: #e9e7e7 url(arrow-square.gif) no-repeat right -51px;
  37.     padding: 7px 15px;
  38.     margin: 0;
  39.     font: bold 120%/100% Arial, Helvetica, sans-serif;
  40.     border: solid 1px #c4c4c4;
  41.     border-bottom: none;
  42.     cursor: pointer;
  43. }
  44. .accordion h3:hover {
  45.     background-color: #e3e2e2;
  46. }
  47. .accordion h3.active {
  48.     background-position: right 5px;
  49. }
  50. .accordion p {
  51.     background: #f7f7f7;
  52.     margin: 0;
  53.     padding: 10px 15px 20px;
  54.     border-left: solid 1px #c4c4c4;
  55.     border-right: solid 1px #c4c4c4;
  56. }
  57.  
  58. dl {
  59.  
  60. }
  61.  
  62. dd {
  63.     margin: 0;
  64.  
  65.     padding: 1em 0;
  66. }
  67.  
  68. dt {
  69.     cursor: pointer;
  70.     font-weight: bold;
  71.     font-size : 1.5em;
  72.     line-height: 2em;
  73.     background: #e3e3e3;
  74.     border-bottom: 1px solid #c5c5c5;
  75.     border-top: 1px solid white;
  76. }
  77. </style>
  78. </head>
  79.  
  80. <body>
  81.  
  82. <div class="accordion">
  83.     <h3>About Us</h3>
  84.     <p>Nunc convallis non turpis at posuere. Vivamus viverra eleifend urna, sit amet dictum dui iaculis mattis. Suspendisse elit diam, blandit eget quam vitae, feugiat auctor leo. Suspendisse potenti. Duis id porttitor sem. Nulla facilisi. Vivamus turpis turpis, venenatis et augue eu, luctus consequat tellus. Fusce consectetur non ligula nec semper. Pellentesque mattis, enim imperdiet lacinia placerat, nisl elit pulvinar lorem, nec porta quam dolor vitae diam.<br />
  85.       . <br />
  86.     <a href="./">Read more...</a></p>
  87.  
  88. <h3>Sign Up For Our Newsletter</h3>
  89.     <p> Subscribe for free to our newsletter to keep up with the news, releases, events and more. </p>
  90.   <p>&nbsp;</p>
  91.  
  92. <h3>Contact</h3>
  93. <p>
  94.     Please fill out this form
  95.   </p><dl>
  96.   <dt>
  97.    <form action="contact_us_how_can1.php" method="post" name="contactform" id="contactform">
  98.    <textarea name="comments" cols="45"  rows="6" class="email1" >How can we help you?</textarea>
  99.    <br />
  100.    Your Name:
  101. <input name="Your_name" type="text" class="email1"  value="Full Name" size="35"  />
  102. <br />
  103. Your email:
  104. <input name="email" type="text" class="email1"  value="email@example.com" size="32"  />
  105.  <br />
  106.  <input type="submit" class="message"    value="   Send Message   " />
  107.    </form>
  108.    </dt>
  109.   </dl>
  110.  <p></p>
  111.  
  112. </div>
  113.  
  114. </body>
  115. </html>
  116.  
  117.  
  118.  
Thanks in advance
damon
Mar 7 '14 #1
0 1150

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

Similar topics

42
2588
by: John | last post by:
Hello. I am a beginner to PHP and I am currently just going through a book, to create a simple form page. Unfortunately it doesn't work, and there is nothing listed on the books errata page on the internet. I wondered if you can just help me with it? It is just a form that you type your name in on the test_form.php page, and then on...
6
1377
by: MAFranklin | last post by:
I've created a form with several input fields. At the beginning of my form I use a set of radio buttons to determine how to validate the form as well as determine what fields are required. Because the form is so lengthy, I would like to aid users by including visual clues as to what fields require information by changing the background color...
3
1759
by: JC Mugs | last post by:
I need help with a project, that has two things driving me crazy. 1. I have number entries that wish to have the data enter from the right, so that when you type in 80, it is .80 or eighty cents. I thought that there was a previous post showing how to do this but my news server doesn't show it. 2. I have a form that is the data entry...
3
6177
by: hermand | last post by:
I've got an online job application I am building using ASP/VBScript. The application consists of one ASP document which has three separate states. States: 1. Form Display 2. Form Review (takes all information submitted from the first form state and removes the form elements and displays entered information using "Response.form()".
4
1329
by: Juan Antonio Villa | last post by:
Hello All. I'm a newbie in programming and I was wondering if I could get some help from you. I have a form with the following fields: ------------------------------------------------- Name Email Age (option field) -> over 45 or under 45 Sex (option field) -> male or female Comments:
1
318
by: Hoopster | last post by:
Here is my form that I''m having problems with. I just can't get an e-mail ??? <p><b class="yellow">Contact Us</b></p> <form action="FormToEmail.php" method="post" enctype="multipart/form-data"> <input class="sidebar" value="name" name="user" >
2
1321
by: Hoopster | last post by:
Here is my form. <form action="http://www.johndoe.com/FormToEmail.php" method="post" enctype="multipart/form-data"> <input class="sidebar" value="name" name="user" > <input class="sidebar" value="email" name="email" > <TEXTAREA class=sidebar name=content rows=40 cols=30></TEXTAREA> <input class="button_sidebar" value="Send"...
6
1899
by: drec | last post by:
I am just learning Javascript and I would like to create a basic form that gives me two options. This will be using either checkbox or radio input type, however I would like the second option to allow the user to type in a value. Also, I would like the 2nd option only editable if the button for that option is selected. All I can seem to...
6
5252
by: ljungers | last post by:
Hi to all and hope someone may have an answer for me. I have a Form named Cust_lukup_Form that has 3 text boxes and a click button that uses a OnClick to call Cust_lukup_Macro that runs an OpenQuery named Cust_lukup_Query using the text box(s) input data running in print view mode. The Cust_lukup_Query has the code setup to query the 3 fields...
32
2764
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put some new ones on. In my code I am doing the following: For Each ctrl In tpMain.Controls If TypeOf (ctrl) Is CheckBox Then If...
0
7478
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...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7773
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...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
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
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
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...

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.