Results 1 to 5 of 5

Thread: manipulating checkboxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    12

    manipulating checkboxes

    I want to put something on a website where a user can click a check box and that box will stay checked and won't be able to be unchecked unless that specific computer or person unchecks it. For example, there are ten check boxes that are different items. Anyone can claim any number of those items, but once they're claimed no one else can claim them and only the user who claimed it can un-claim it. I really don't have much knowledge of PHP, but I figure i'll have to use cookies or something to know which user can un-check certain boxes.
    Thanks for any help.

  2. #2
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: manipulating checkboxes

    where do you save your list of users?

    1. anywayz, assuming you got your username saved in a cookie, you could assign hidden fields to each checkbox (its all up to you how to implement that) and then whenever a user clicks on a checkbox, check the corresponding hidden input field against the current user saved in the cookie using javascript.

    2. you could do a submit everytime a user clicks the checkbox, and have php in the server side do the checking for you. this way you don't need to show which user has access to which checkbox.

    3. some other better ideas are floating about, for now i only have the above two.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    12

    Re: manipulating checkboxes

    But I want to do it without having actual users. Sorry if I didn't make that clear enough. When I said user, I meant the person on a computer

  4. #4
    Junior Member
    Join Date
    Oct 2005
    Posts
    17

    Re: manipulating checkboxes

    Use their IP instead then, to get it with php it would be $_SERVER["REMOTE_ADDR"]

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

    Re: manipulating checkboxes

    Disabling the checkbox is possible. But you also need a server side flag to assertain wherther or not a partiular userr has ticked the box. Presumably it will be disabled for all other uses except the one who checked it.

    How are you planning on storing this information? Database, files?
    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.

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