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

  • SEARCH
  • Home
  • 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 8205041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:05:27+00:00 2026-06-07T08:05:27+00:00

i have a simple show/hide div and a form on the div, but when

  • 0

i have a simple show/hide div and a form on the div, but when i submit the form the div hide again on the reload, how i stop this behavior?

Script:

$(function() {
  $('.Mbox').hide().click(function(e) {
    e.stopPropagation();
  });      
  $("#Mbutton").click(function(e) {
    $('.Mbox').animate({ opacity: "toggle" });
    e.preventDefault();
  });

});

Div:

<li><div class="Mbox"><input type="text" id="conversation_username" class="span5"  name="conversation_participant[nome]" placeholder="Para: Nome"/>
 <%= text_area :message, :body, :class => "span5", :rows => 5, :placeholder => "Mensagem" %>
 <%= f.button "Send", :class => "botao" %></div></li>
  • 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-07T08:05:29+00:00Added an answer on June 7, 2026 at 8:05 am

    Sounds like when the page is initially loaded, the div is hidden, then you click to show the div and fill out the form. On form submission, the page reloads, and the div reloads as hidden, when you want it to still be shown.

    (Assuming that the div initially being hidden is controlled in CSS as I do not see it elsewhere in the code provided)

    If this is the case, I think you have two options..

    1. Handle it on the server side, when building the response to the form submit, insure you are changing the div to be shown in the returned response

    2. Handle it on the client side if possible, if, say, the form shows the filled in values after the reload, but never has values when the page is initially loaded, you could write some JS to show the div if there are values in the form.

    I would also look at having the page not do a full reload on form submit if your coming back to the same page with the same data and want it to look just the same. Perhaps you should be submitting via AJAX and not reloading the page at all?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have this simple code $('#info_name'+index).show(slide, {direction: right}, 1000, function(){ $('#info_info'+index).show('slide',{direction: up}, 1000);
I have a script.I will show sample. <form> <textarea id='input'></textarea> <input onclick=convert() value=go function
I have a simple hide show jquery script I grabbed from an example site.
I have some simple jQuery toggle script like this: <script type=text/javascript> $(document).ready(function() { $('#clickedit').click(function()
Made a simple script that hide/show a hidden div. The page automatically adjusts its
I know this has been asked many times before... I have a simple ('#Div').load(file.php?id='+id+'&page='+page)
I am using a simple jquery toogle to show and hide a form. What
I have the following three functions: $(.redDiv).hover(function() { $(.blueDiv).show(); }, function() { $(.blueDiv).hide(); });
I'm trying to make a simple Click on Div -> Hide DIV -> Show
I have a simple form: <div class=class_a> <fieldset> <label><input type=radio id=radio10 name=color value=1 />Red</label><br

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.