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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:26:02+00:00 2026-06-18T01:26:02+00:00

I am styling a zend powered form so have don’t want to change markup.

  • 0

I am styling a zend powered form so have don’t want to change markup.

I am trying to hide the textarea and it’s label when the radio button value is no but when it is yes the textarea and label should appear.

Problem I have is if the textarea is not filled out once yes is selected, and the submit button is pressed, zend shows it’s own error message which is good, but because the page is reloaded due to the submit action it keeps the value of yes on the form but hides the textarea and label, so you have to re-click the yes value to get them to appear again.

Goal – if the yes button is selected, the textarea and label appears, but if the textarea is not filled out and the submit button is hit, the error appears but also the yes value is still selected AND the textarea and label are still visible until no is hit!

My code so far –

$(function(){
    if ($('#declarations-refused-y').is(':selected')) {
        $('#declarations-refusedText-label, #declarations-refusedText-element').show();
    }
    else {
        $('#declarations-refusedText-label, #declarations-refusedText-element').hide();
    }          
});
  • 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-18T01:26:03+00:00Added an answer on June 18, 2026 at 1:26 am

    Use :checked instead of :selected.

    $(function(){
      if ($('#declarations-refused-y').is(':checked')) {
        $('#declarations-refusedText-label, #declarations-refusedText-element').show();
      } else {
        $('#declarations-refusedText-label, #declarations-refusedText-element').hide();
      }          
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm styling a form that was already marked up (made some markup changes), and
Possible Duplicate: Styling <input type=file> Style input type file? I`m trying to change a
I'm styling a form by using a table with fixed-width columns and I want
I'm styling my UINavigationBar with UIAppearance . I want all the back buttons to
I'm styling a form designed by a client with the following structure: <div class=formRow>
I have a problem styling/templating an AccordionItem in the accordion control from the silverlight
Struggling with styling the mouse over for a button ... I have managed to
I use some CSS styling to hide input buttton, images and so on but
I've been trying to get styling working on site uncookedblog.com for hours now. I
Possible Duplicate: Styling the cancel button in a UISearchBar I am trying to set

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.