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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:11:41+00:00 2026-06-17T22:11:41+00:00

i did asked this before, but my client wanted to create a little functionality

  • 0

i did asked this before, but my client wanted to create a little functionality over the questionnaires. he wants all “Notes text-field” will be hidden if it is empty. it will be visible only if the “Notes text-field” have value. also the Yes / No radio button need to be updated / checked as well if there’s a value or no value. here’s the previous code that “insomniac” did.

$('.notes').hide();
$('input[type="radio"]').change(function () {
  if ($(this).val() == "Yes") {
    $(this).closest('tr').next('tr.notes').slideDown();
  } else {
    $(this).closest('tr').next('tr.notes').slideUp();
  }
});

however, i need to validate first the text-field if there’s a value (actually 1 to 33 text-field will be use here and most of it will have value).

var vals = $('.notes input[type="text"]').val(); 
if(vals == "") {
  console.log('negative');
  $('tr.notes').slideUp();
} else {
  console.log('positive');
  $('.query input[value="Yes"]').attr({
    checked: "checked"
  });
  $('tr.notes').slideDown();
}

here’s the original format of what i am discussing… jQuery Bind or Index Form and Insomniac Demo

  • 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-17T22:11:42+00:00Added an answer on June 17, 2026 at 10:11 pm

    after some research and non-stop working the script. i finally decide to update the code into basic settings. “im not a programmer” actually…

    $(".report-notes fieldset").each(function (i) {
    i = i+1;
    $(this).addClass("item"+i);
    $('.item'+i+' input[type="radio"]').on('change',function(){
        if($(this).val() == 'Yes') {
            $('.item'+i+' .notes').slideDown();
        } else {
            $('.item'+i+' .notes').slideUp();
        }
    });
    
    $(document).ready(function(){
        var notes = $('.item'+i+' .notes input[type="text"]').val();
        if(notes === '') {
            console.log('walang laman');
            $('.item'+i+' .notes').hide();
        } else {
            console.log('meron laman');
            $('.item'+i).find('input[value="Yes"]').attr({
                checked: "checked"
            });
            $('.item'+i+' .notes').slideDown();
        }
    });
    });
    

    Updated Fiddle Source

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

Sidebar

Related Questions

I have asked this question before but did not get the satisfied answer as
I was asked this before with slight different with current question. but did not
another memory management question: I have asked this before, but did not really get
Probably this question was already asked before, but my google-fu and SO-Search did not
Apologies if this has been asked before, but I did some searching and wasn't
I'm guessing this has been asked before, but I did some searching and haven't
I know this has been asked before, but I did not find its answer
I apologize if this has been asked before. I searched but did not find
Guys I have asked this question before but did not receive a single comment
Fellow coders, I have asked this question before but did not get a conclusive

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.