Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Problems with simple JQuery functions (hide/show)

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23362
    pghtech
    Member

    I am attempting to hide and disable a DIV class (see code below) and I cannot for the life of me figure out what I am doing wrong.

    The code below is actually suppose to hide a DIV of class "optional-field" unless you choose a certain option from the drop down form with select name of "productOptions[2]". This might be an odd "select name" but it is because it is dynamically created by PHP. But if you choose "Someone Else" it should "show()" that DIV. It should also hide it wheen page loads.

    However, dispite that, I tried just doing a simple hide command of another div not dynamically created

    Code:

    and I can't even get that to hide.

    Below is the code for both the function and then the HTML:
    NOTE: for the form select name, the HTML code shows the PHP place holder of

    Code:

    but when created it is

    Code:

    Javascript:

    Code:

    HTML

    Code:



    {VAL_OPTS_NAME}
    {VAL_OPTS_NAME}

    ({VAL_OPT_SIGN}{VAL_OPT_PRICE})




    What am I missing?

    #50306
    RhapX
    Member

    Make sure you’re loading the jQuery functions you’re wanting to use.

    Code:
    $(document).ready(function()
    {
    $(“#boxContent”).hide();
    })

    This should be how all of your stuff should look. Basically it shows that jQuery is to be loaded once the DOM is finished loading. Should solve your problem.

    #50385
    pghtech
    Member

    Thanks all for the input. It turned out to be that it didn’t like where I had the <script>…./jQuery.js</script> put as far as order AND because I was also using the scriptaculous.js and prototype.js which were also causing conflict.

    Thanks,

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.