dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Help with hiding ‘channel’, but not ‘category’ in Upload Form

  1. #1
    Join Date
    Feb 2005
    Posts
    64

    Help with hiding ‘channel’, but not ‘category’ in Upload Form

    This web script's Upload Form allows the user/uploader to choose 'channel' and 'sub-category' to upload to. I tried hiding the channel like so:

    Code:
    <li style="width:400px; text-align:left;">
    <input type="hidden" name="channel" value="1"/></li>
    so that the channel is essentially pre-chosen, which works successfully on it's own, but there is no drop-down choices for sub categories showing.

    But, if I revert back to the Form script that doesn't hide the channel, and makes you choose a channel, then the sub-categories will show. Here's that code:

    Code:
    <li style="width:240px; text-align:right;"><strong>[var.lang_select_channel]:</strong></li>
    <li style="width:400px; text-align:left;">
    
    <select class="upload-video-form-input" style="width:160px;" size="1" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">
    &nbsp;[var.fields_all;htmlconv=no]</select>&nbsp;([var.lang_select_one])</li>
    
    <li style="width:240px; text-align:right">&nbsp;</li>
    <li style="width:380px" class="font5_14"><strong>[var.lang_sub_categories]</strong></li>
    
    <li style="width:240px; text-align:right"><strong>[var.lang_sub_cat]:&nbsp;</strong></li>
    <li style="width:400px; text-align:left;" id="sub_change"><select class="upload-video-form-input" style="width:160px;" size="1" name="sub_cat"></select>&nbsp;([var.lang_optional])</li>
    I'm wondering if there is a way/tweak to hide the channel, AND allow the sub-categories to be shown. Any ideas/help will be appreciated.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    21,159
    Maybe the simple way would be to move the onchange JavaScript event to be an onload event in the <body> tag, instead?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

  3. #3
    Join Date
    Feb 2005
    Posts
    64
    Thank you for your reply.
    Can you give me a code example of what you mean?

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    21,159
    I tried to reply with an example, but the forum keeps barfing on something (probably thinks I'm trying to inject JavaScript code )

    Where you see in your code an "o n c h a n g e" attribute with a bunch of stuff in quotes after the equal sign, copy that entire attribute (from the "o n c h a n g e" name through the closing quote of what is assigned to it). Delete it from that point in your HTML, and instead stick it inside the opening body tag, renaming the attribute to "o n l o a d", instead of "o n c h a n g e". (I'm hoping those spaces -- which you don't want in the actual code! -- will get past whatever the forum software is gagging on.)
    Last edited by NogDog; 07-19-2016 at 08:17 PM.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

  5. #5
    Join Date
    Feb 2005
    Posts
    64
    Thanks for that effort. Much appreciated. However, that didn't work. It showed no sub-categories

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles