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 8724831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:54:38+00:00 2026-06-13T07:54:38+00:00

I have a DIV that slideToggles no problem. It reveals some additional options to

  • 0

I have a DIV that slideToggles no problem. It reveals some additional options to the visitor. Once the form is submit, if for example an error is encountered the visitor presses their browser back button to rectify. The div with all the additional options is not in the state is was last left, rather it is collapsed. Any ideas how I can prevent this?

    $("#sendChange").click(function () {
                          $("#sendSpec").slideToggle("slow");
                        if($('#sendWhen').html() == 'IMMEDIATLY'){
                           $('#sendWhen').html('AS SPECIFIED');
                        }else{
                           $('#sendWhen').html('IMMEDIATLY');
                        }
                        return false;
});




<div class="fcenter stdBox line25" style="margin-bottom:0px;" id="emlOptions">
<div>
     <label class="lab">Send email: </label><span id="sendWhen" class="blue">IMMEDIATLY</span> <a href="#" id="sendChange">[change]</a>
</div>
<div style="display:none" id="sendSpec">
    <label for="userTz" class="lab">Timezone: </label><select name="userTz" id="userTz" onchange="tzChange(this.value)" class="field" >
<option value="Pacific/Apia">(GMT-11:00) Midway Island, Samoa</option>
<option value="Pacific/Honolulu">(GMT-10:00) Hawaii</option>
...
</select>  <br />

<label for="delayTimeDate" class="lab">Time & Date: </label><input type="text" class="field" name="delayTimeDate" id="datepicker" />
<br /><br />
</div>

So I tried adding a hidden text field which worked in FF but not Opera. Opera forgets the hidden field values but not text field ones so I wrapped the text field in a display:none div which remembers the value ok but javascript fires before the formfield has its value updated by the Opera browser. Here is the code:

function sendSpec () {
                          $("#sendSpec").slideToggle("slow");
                        if($('#sendWhen').html() == 'IMMEDIATLY'){
                           $('#sendWhen').html('AS SPECIFIED');
                           $('#sendWhenState').val('1');
                        }else{
                           $('#sendWhen').html('IMMEDIATLY');
                           $('#sendWhenState').val('0');
                        }}

$("#sendChange").click(function () {
                     sendSpec();
                    return false;
});
if($('#sendWhenState').val() == 1){
    sendSpec();
}

HTML is the same but with the added formfield

<div style="display:none"><input type="text" id="sendWhenState" value="0" /></div>

I don’t like this but couldn’t find another way. the above is the same just added a timeout to the if sendWhenState == 1 so that Opera will have updated the fields before I check their value like so:

setTimeout(function(){
                    if($('#sendWhenState').val() == 1){
                       sendSpec();
                    }
         },1000);

I’m new here, should I have answered my own question or was I right to edit the question with the solution I came up with?

  • 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-13T07:54:39+00:00Added an answer on June 13, 2026 at 7:54 am

    I added a hidden text field which worked in FF but not Opera. Opera forgets the hidden field values but not text field ones so I wrapped the text field in a display:none div which remembers the value ok but javascript fires before the formfield has its value updated by the Opera browser. Here is the code:

    function sendSpec () {
                              $("#sendSpec").slideToggle("slow");
                            if($('#sendWhen').html() == 'IMMEDIATLY'){
                               $('#sendWhen').html('AS SPECIFIED');
                               $('#sendWhenState').val('1');
                            }else{
                               $('#sendWhen').html('IMMEDIATLY');
                               $('#sendWhenState').val('0');
                            }}
    
    $("#sendChange").click(function () {
                         sendSpec();
                        return false;
    });
    if($('#sendWhenState').val() == 1){
        sendSpec();
    }
    

    HTML is the same but with the added formfield

    <div style="display:none"><input type="text" id="sendWhenState" value="0" /></div>
    

    I don’t like this but couldn’t find another way. the above is the same just added a timeout to the if sendWhenState == 1 so that Opera will have updated the fields before I check their value like so:

    setTimeout(function(){
                        if($('#sendWhenState').val() == 1){
                           sendSpec();
                        }
             },1000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that hides a div by default and slideToggles it when
I have a div that I click on to drag it. Once it's on
I have a div that expands to the height of it's content. It works
I have a div that will serve as container to other element, I have
I have a div that contains a list of messages (it's a chatroom application).
I have a div that is position: absolute and it contains items that get
I have a div that is absolutely positioned from the top left corner of
I have a div that has a one pixel solid white border on the
i have a div that it have image content .i wanna implement animation when
I have a DIV that I want to touch the bottom of the screen

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.