phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] Trouble with forms


From: Chris Weiss
Subject: Re: [Phpgroupware-developers] Trouble with forms
Date: Wed, 14 Aug 2002 16:40:16 +0000

When you have more than one form you can only submit one of them, so the
field value from the other form is not really set to nul but field simply
isn't there at all.  In the case that you try to change cat_name, an isset
($multi1) will return false, assuming register_globals is on.


Brian Johnson (address@hidden) wrote*:
>
>I'm trying to add a field to the catagory table in the timetrack module and
am
>having trouble figuring out the form to edit the catagories under the admin
module
>
>Currently, it allows you to edit the catagory name in an input box and hit
enter to
>submit it.  I would like to be able to edit the two fields in the same
manner.
>
>I need two forms (each one with one input box) or I need a submit button -
tell me
>if I'm wrong on this
>
>I have:
>
>          echo '<form method=POST action="'
>             . $GLOBALS['phpgw']->link("/timetrack/admin3.php","cat_id=" .
>$catagory_id . "&mode=accept")             . '">';
>          echo '<td><input name="cat_name" value="' .
$catagory_name . '"></td>';
>          echo '</form>';
>          echo '<form method=POST action="'
>             . $GLOBALS['phpgw']->link("/timetrack/admin3.php","cat_id=" .
>$catagory_id . "&mode=accept")             . '">';
>          echo '<td><input name="multi1" value="' . $multi . '"></td>';
>          echo '</form>';
>
>          $GLOBALS['phpgw']->db->query("update phpgw_ttrack_wk_cat set
>catagory_desc='$cat_name' "
>            . ", billout_multiplier='$multi1' where
work_catagory_id='$cat_id'");
>
>
>It defaults to display the current values properly, but if I hit enter in
one box
>(accept on one form),  the value of the other input box is set to null - not
the
>default value
>
>Otherwise, it works as expected (the edited value is changed properly).
>
>How can I make coding to get the second input box to not reset the current
value?
>
>PS - yes I know catagory is spelt incorrectly
>
>
>
>_______________________________________________
>Phpgroupware-developers mailing list
>address@hidden
>http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]