How to shorthand if else in jQuery function?

Question about jQuery toggle function?

  • Alright so I have this contact form that I want to hide using the jQuery toggle function but I can't seem to get it to work. If someone could help me out that would be greatly appreciated. I am trying to use an image as the toggle switch but I just can't seem to get it to work. I have tryed implementing the code but I may be doing this all wrong. I can't seem to get the whole contact form in a div table that I can hide and show. The code for my contact section is below. Any help would be appreciated. :) <div id="Layer-3"<body onload="MM_preloadImages('includes/image… src="includes/images/Layer-2_with.png" id="Image51" /> </div> <div id="Layer-2" onclick="MM_swapImage('Image51','','incl… > <div id="page-wrap"> <form method="post" action="contactengine.php" id="commentForm"> <fieldset> <div id="formLeft"> <div class="input-bg"> <input type="text" name="Name" id="Name" class="required" minlength="2" /> </div> <div class="input-bg"> <input type="text" name="Email" id="Email" class="required email" /> </div> </div> <div id="formRight"> </td> <div class="message-bg"> <textarea name="Message" id="Message" rows="20" cols="20" class="required"></textarea> </div> <input name="submit" type="image" class="submit-button" id="Image52" onmouseover="MM_swapImage('Image52','','… onmouseout="MM_swapImgRestore()" value="Submit" src="includes/images/Layer-4.png" /> </div> <div class="clear"></div> </fieldset> </form> </div> </div>

  • Answer:

    Nice seeing you again, I'm sorry my original answer wasn't enough. Here's your form setup with the jquery: http://dwighttinker.com/dev/example/contact.html View the page source from your browser to see how it works

Bumblebe... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Look your html script again, the onmouseover are not correct, it has to have a closing function call like this (); For slide toggle in JQuery you have to write the JavaScript. <script type="Text/javascript"> function hidClick(){ $("#idnamehere").slideToggle("slow"); } </script>

Gabs777

if your question is about jQuery, you need to post the jquery code as well.

Douglas P

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.