473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Accordion Form help

nomad
664 Expert 512MB
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 1144

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

Similar topics

42
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...
6
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...
3
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...
3
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...
4
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...
1
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"...
2
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"...
6
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...
6
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...
32
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
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...

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.