SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Checkboxes

  1. #1
    SitePoint Addict
    Join Date
    Jan 2008
    Location
    Shaw AFB
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Checkboxes

    I have a small file management system that I've built.

    When you're browsing over the files - there are two checkboxes associated with each file. You can either e-mail the file(s), or delete the file(s).

    How do I get two different forms going so that one button sends my array of selections to "email.php" and one button forwards my array of selections to "delete.php"
    ~ Nate L ~

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Just set up a simple form and check for each checkmark and do the appropriate action. This belongs in the PHP section (or the server side language or some other place. Not here)
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,189
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    It might be easier to send the form results to "decider.php" and have that forward them to either "email.php" or "delete.php"

    Or combine the code from both files into one, if it won't get too big and messy.

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unless you really intend to allow a user to delete and email at the same time, checkboxes aren't a good choice for a form control. Consider radio buttons.

  5. #5
    SitePoint Addict
    Join Date
    Jan 2008
    Location
    Shaw AFB
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    It might be easier to send the form results to "decider.php" and have that forward them to either "email.php" or "delete.php"

    Or combine the code from both files into one, if it won't get too big and messy.
    I was dinkin around in phpMyAdmin when I realized they have essentially the same thing. When you select multiple entries - at the bottom it says "With Selected:" and then a drop down list of what action you want to take

    Quote Originally Posted by crmalibu View Post
    Unless you really intend to allow a user to delete and email at the same time, checkboxes aren't a good choice for a form control. Consider radio buttons.
    Well, the problem with that is there needs to be multiple selections. e-mail to multiple people OR delete multiple selections.

    The solution, I think, is what I just posted. Having one set of check boxes - and then an option to either delete or send an e-mail.


    Having a set of check boxes for each option is over complicating things, I think
    ~ Nate L ~


Bookmarks

Posting Permissions

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