SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    to place several submit-buttons

    Hey,

    In my script I have 4 forms for add, edit, delete and search and in the middle of the page the Mysql-database table.
    That means that I have 4 submit-buttons and I would like to place them on the right side of the table in a special order.

    To place submit-buttons at a special place seems to me very difficult also because they are in different forms.
    How can I handle this buttons? Can I move them out of the form? Connect them from the outside over if/else? Use an image button? (I don't want to use javascript.)

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use one form, with four submit buttons.

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That means that I put at the beginning of the script
    PHP Code:
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>
    Then comes the code for handling add, edit, delete and search and the database table.

    And at the end:
    PHP Code:
    <input type="submit" value="ADD" />
    <
    input type="submit" value="EDIT" />
    <
    input type="submit" value="DELETE" />
    <
    input type="submit" value="Search" />
    <
    input type="text" name="searchtext" />

    </
    form
    Something like this?

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah just have you script examine which submit button was used to decide what to do.


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
  •