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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:17:27+00:00 2026-05-31T00:17:27+00:00

I´ve got this code inside a php file. It should show and hide a

  • 0

I´ve got this code inside a php file. It should show and hide a piece of html stuff according to specific parameters (I have a set of checkboxes and if you check them, some stuff appears or hides according to wich checkbox it is).

Now, after getting many errors because of my stylesheet, and after stripping it off, I still get this one: “hide is not defined” in firefox error console (I´ve tried the error console in firebug, and shows nothing).

This is the code, and I don´t understand how hide could be not defined:

   $script =
  $("input[id^=\'edit-field-tipos-unidades-disponible-value\']").change(function(){' .
    $(".fila-matriz-gastos").hide();' .
    $(".fila-matriz-gastos").prev("label").hide();' .
    $("input[id^=\'edit-field-tipos-unidades-disponible-value\'][checked]").each(function(){' .
      var tipo = $(this).val();' .
      $(".tipo-uf-" + tipo).show();' .
      $(".tipo-uf-" + tipo).prev().show();' .
      $("input.tipo-uf-"+tipo+"[value=-1]").click(function(){' .
        $("input.tipo-uf-" + tipo).attr("checked", $(this).attr("checked"));' .
      });' .
    });' .
  }).change();';

I´m pretty much at a loss here, because I want to theme the output, but I don´t understand much of how javascript works.

Thanks!!

UPDATE:

This is the output that hides or shows:

    <fieldset class=" collapsible">
<legend>
<a href="#">Matriz de Gastos</a>
</legend>
<div>
<div class="form-item">
<label style="display: none;">
Gastos por
<em>Departamento</em>
:
</label>
<div class="form-checkboxes tipo-uf-131 fila-matriz-gastos hidden" style="display: none;">
<div id="edit-matriz-gastos-131--1-wrapper" class="form-item">
<label class="option" for="edit-matriz-gastos-131--1">
<input id="edit-matriz-gastos-131--1" class="form-checkbox tipo-uf-131 fila-matriz-gastos hidden" type="checkbox" value="-1" name="matriz_gastos[131][-1]" style="display: none;">
Seleccionar/deseleccionar todos
</label>
</div>
<div id="edit-matriz-gastos-131-108-wrapper" class="form-item">
<label class="checkbox" for="edit-matriz-gastos-131-108">
<input id="edit-matriz-gastos-131-108" class="form-checkbox tipo-uf-131 fila-matriz-gastos hidden" type="checkbox" value="108" name="matriz_gastos[131][108]">
Gas
</label>
</div>

And this is is a checkbox that hides or shows the stuff, according to click on it or not:

Checked:

<label style="display: block;"><label style="display: block;">
Gastos por
<em>Departamento</em>
:
</label>
<div class="form-checkboxes tipo-uf-131 fila-matriz-gastos hidden" style="display: block;">

Unchecked:

<label style="display: none;">
Gastos por
<em>Departamento</em>
:
</label>
<div class="form-checkboxes tipo-uf-131 fila-matriz-gastos hidden" style="display: none;">

AND ANOTHER UPDATE:

Here´s what I´ve found at jQuery docs:

Hide .hide() function – DOM manipulation

This function hide the matching elements on the page. What it does is
to set the display configuration to ‘none’. You can set a speed for
the disappearance ‘fast’, ‘normal’ or ‘slow’ and a callback function
being executed after the affect is allowed.

Example

$("#class_div").hide();

Before
<div id='class_div'>Hello world</div> <div id='class_div_2'>Hello world</div>

After:
<div id='class_div' style="display:none;">Hello world</div> <div id='class_div_2'>Hello world</div>

  • 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-05-31T00:17:28+00:00Added an answer on May 31, 2026 at 12:17 am

    .hide is probably a jQuery function. I think you removed jQuery from the page. In FireBug, got to the scripts tab and look for jQuery in the loaded files. Do you see it?

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

Sidebar

Related Questions

I got this code in my submit form <form id=myform action='hello.php' method='GET'> <input type=button
So I got this code to list all jpg images inside a directory but
So I've got all of this really neato PHP code and I've started doing
I got an XML file being echoed by PHP and all the code works
I've got 800 lines of JS code inside a php script for a site,
Got this code for a viewscroller from the apple developers site. @synthesize scrollView1, scrollView2;
I got this code in order to build an url for the link using
I got this code from the wordpress <head profile=http://gmpg.org/xfn/11> What does this means? what
I got this code ` // // prints out Hello World! // hello_world(); //First
i got this code $current_path = str_replace('\', '/', getcwd()); //c://xampp/htdoc Why it fail replace

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.