Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Additional row being created with HTML "<form>" tags

  1. #1
    Join Date
    Jun 2003
    Posts
    284
    Rep Power
    0

    Default Additional row being created with HTML "<form>" tags

    Why is it that whenever I use something like :


    Code:
     <table>
      <tr> 
       <td>
        <form> 
          DECLARATION FOR BUTTON 1 GOES HERE
        </form>
       </td>
      </tr>
    
      <tr> 
       <td>
        <form> 
          DECLARATION FOR BUTTON 2 GOES HERE
        </form>
       </td>
      </tr>
    
      <tr> 
       <td>
        <form> 
          DECLARATION FOR BUTTON 3 GOES HERE
        </form>
       </td>
      </tr>  
     </table>


    The form tags somhow manage to create an additional row below each "BUTTON" ? How can that be ? And is there anyway for me to work around this....I really can't afford and additional extra row on my page not only does it not look good it is taking up valuable screen space
    Last edited by bluwulf; Aug 30, 2004 at 07:05 PM.
    ﻈļŭώŭļƒ

  2. #2
    Join Date
    Apr 2003
    Posts
    13,270
    Rep Power
    35

    Default Re: Additional row being created with HTML "<form>" tags

    Try putting the form tags outside of the <tr> tags.
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

  3. #3
    Join Date
    Jun 2003
    Posts
    284
    Rep Power
    0

    Default Re: Additional row being created with HTML "<form>" tags

    Ok...I will go try that !
    ﻈļŭώŭļƒ

  4. #4
    Join Date
    Jun 2003
    Posts
    284
    Rep Power
    0

    Default Re: Additional row being created with HTML "<form>" tags

    Great that seemed to work...thanx again....!
    ﻈļŭώŭļƒ

  5. #5
    Join Date
    Apr 2003
    Posts
    13,270
    Rep Power
    35

    Default Re: Additional row being created with HTML "<form>" tags

    You're Welcome.
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

  6. #6
    Join Date
    May 2003
    Posts
    3,041
    Rep Power
    0

    Default Re: Additional row being created with HTML "<form>" tags

    I know you probably have your reason...but I got to ask...
    Why are you using multiple forms on one page?
    Calm Like a BOMB

  7. #7
    Join Date
    Jun 2003
    Posts
    284
    Rep Power
    0

    Default Re: Additional row being created with HTML "<form>" tags

    Quote Originally Posted by matronyx
    I know you probably have your reason...but I got to ask...
    Why are you using multiple forms on one page?


    Well actually I don't have a reason apart from I really don't kno of a better way to do it....i.e how do I separate the actions of each BUTTON ? You see I thought that I could use a single form .....but the last I tried that I ran into the problem where my program didn't know which one of the buttons were being pressed.....take for example this:



    Strange Redirection problem in PHP


    It wuz the fact that I had a single form with two buttons declared in it with that caused the problem. In particular whenever the form declaration directed (upon pressing the LOG OUT BUTTON) you to the login.php page but whenever you pressed the SUBMIT buton the sameform declaration would again (which makes sense) direct you to login.php
    page.....If there is some other way around this jus let me kno......I appreciate it....thanx...
    ﻈļŭώŭļƒ

  8. #8
    Join Date
    Apr 2003
    Posts
    13,270
    Rep Power
    35

    Default Re: Additional row being created with HTML "<form>" tags

    Of course there is. Using a bit of javascript and naming your buttons using ID's, you shouldn't have a problem at all using a single form. Just show us what you're trying to do, and I'm sure we can come up with some code for you to use.
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

  9. #9
    Join Date
    May 2003
    Posts
    3,041
    Rep Power
    0

    Default Re: Additional row being created with HTML "<form>" tags

    Instead of using a onSubmit in your form...you could try something like...
    Code:
    <td>
    <input type="button" name="edit_user" value="Permissions" onClick="document.location.href='console_main.php?which_function=draw_config_user_permissions&username=bluwolf'">
    </td>
    <td>
    <input type="button" name="edit_user" value="Permissions" onClick="document.location.href='console_main.php?which_function=draw_config_user_permissions&username=matronyx'">
    </td>
    You could let php generate the above html in a page and use a for loop to automatically assign different users to a button.
    Sorry, got to cut it short right now... light gone and mi deh pon backup!!!
    Calm Like a BOMB

  10. #10
    Join Date
    Jun 2003
    Posts
    284
    Rep Power
    0

    Default Re: Additional row being created with HTML "<form>" tags

    Quote Originally Posted by Arch_Angel
    Of course there is. Using a bit of javascript and naming your buttons using ID's, you shouldn't have a problem at all using a single form. Just show us what you're trying to do, and I'm sure we can come up with some code for you to use.


    Well....I appreciate the help...but what I'm trying to do is a little less straight foward (by no means complicated) than the initial post...U see the different buttons are in different functions (them themselves contain other tables and buttons) that are called within a <table></table> declaration.....so U see it's not as straight forward as di initial post.....but what I have works now though...thanx to U'r post......


    And thanx matronyx for your help too.....

    I will defiantely take up your advise and suggestions for my next project though

    (I now realise I will have to go learn JavaScript)



    /************************************************** *******/




    That said I have a different problem (I'm not so sure if I should start a new post for this)




    I have a form that the user is presented with. This form contains 7 drop down menus 1 input box and 1 textarea (all the elements of the form contains preselected data which the user is allowed to change) and at the press of a button the user is allowed to UPDATE data in a DB.....


    Now what I would want to do is avoid xecuting an UPDATE statement on the DB (thus avoid wasting server resources) if the user pressed the UPDATE button but didn't change anything in the form.....currently the UPDATE is executed regardless of whether the user changed anything.....thus wasting the server resources.....jus imagine a user sitting there jus continually pressing the UPDATE button while not making any change.......




    Also currently if the user makes a no change or makes a change to all 9 elements of the form the UPDATE statement simply executes an UPDATE statement on all elements...thus simply overwriting the data in the with was already there....i.e it does a "wholescale" "UPDATE" regardless of what is actually changed....



    Is there a way for me to determine what the user changed (in the form) and thus only update that ?
    ﻈļŭώŭļƒ

Posting Permissions

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