Results 1 to 3 of 3

Thread: PHP & HTML Problem

  1. #1

    Thread Starter
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    Red face PHP & HTML Problem

    Hello,

    I have a html form in which there are some checkbox with values. You can click as many checkboxes as you like which beomes an array when submitted.

    For eg: <input type="checkbox" name="cb[]" value="1">
    <input type="checkbox" name="cb[]" value="2">
    <input type="checkbox" name="cb[]" value="3">

    Now the thing is that i have converted those checkboxes into a dropdown like following:

    <select name="cb[]">
    <option value="1">First</option>
    <option value="2">Second</option>
    <option value="3">Third</option></select>

    In this dropdown i want to add a option named: "all". So which will mean that all the options are selected. I know its easy but here the problem starts. I cannot modify the php code becuase its zend encoded. So i have to use html or javascript only to get this done.

    Can anyone tell me in what way should i place values in the dropdown "all" option so when the form is submitted the php file thinks that all the options have been checked out.

    Thanks.
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: PHP & HTML Problem

    I would advise that you have a hidden field. When an item is select, it loads the value into the hidden field. If ALL is select, it loops through the items in the dropdown and appnds a new hidden field with the same anme for each one.

    I posted a function here which creates hidden fields dynamically. A little modification and you should be able to apply it to your problem.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    Re: PHP & HTML Problem

    Hi,

    Can i have a code for that ? I am weak in java scritping.

    Thanks.
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

Posting Permissions

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



Click Here to Expand Forum to Full Width