Loading ...
Sorry, an error occurred while loading the content.
 

Re: InitialValue/DefaultValue for inputs

Expand Messages
  • Shekar C. Reddy
    Well! It s the same concept we use in client/server apps where we provide initial/default values for fields in insert mode for user- friendliness so the user
    Message 1 of 23 , Apr 6, 2006
      Well! It's the same concept we use in client/server apps where we
      provide initial/default values for fields in insert mode for user-
      friendliness so the user does not have to key-in values if they are
      acceptable to the user.



      --- In forms-dev@yahoogroups.com, "Shekar C. Reddy"
      <powerobject@...> wrote:

      Manuel,

      I guess I wasn't clear. I always call LoadInputValues() with the
      boolean whether the form is submitted or not. Currently, the
      form_class is doing the right thing. But I'm searching if there is a
      technique to assigning user-friendly initial values to inputs (any
      inputs; not just checkboxes) that get populated into the Changes
      array when submitted. When I assign a VALUE to an input (to serve as
      a default value to pre-fill a field so the user does not have to key-
      in the value) and the user submits the form accepting the default
      value as-is, the Changes array does not get populated with the field
      and its (default) value because the value is the 'same' as before
      and did not 'change'.

      Something on the lines of VALUE-vs-DefaultValue.

      Eg for a checkbox:

      VALUE =( self::$new ? 0 : $data[ 'value' ] )
      DefaultValue =1 (used only in insert-mode)

      However, if I pre-fill:
      VALUE =( self::$new ? 1 : $data[ 'value' ] )

      it does not get populated into Changes array if the user accepts the
      pre-filled value and submits the form because the value is the same
      as it was before and did not change.


      Regards,



      >
      >
      >
      > --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@> wrote:
      > >
      > > Hello,
      > >
      > > on 04/06/2006 04:03 AM Shekar C. Reddy said the following:
      > > > Is there a way to simulate a 'default' value for an input? For
      > > > instance, if I set the initial value for a checkbox to 1 in
      > insert
      > > > mode, it is effectively bypassing the validations (which is
      ok)
      > but
      > > > not populating the Changes array when the form is submitted.
      > This is
      > >
      > > This problem was already mentioned before.
      > >
      > > For checkboxes, radio buttons, and multiple select inputs, when
      > you call
      > > LoadInputValues you need to pass a boolean value to tell whether
      > the
      > > form is being submitted or is presented for the first time.
      > >
      > > The default is that the form is not being submitted, so
      > LoadInputValues
      > > will not look whether those kinds of inputs are being changed.
      > >
      > > So, your problem has nothing to do with the initial value.
      > >
      > > --
      > >
      > > Regards,
      > > Manuel Lemos
      > >
      > > Metastorage - Data object relational mapping layer generator
      > > http://www.metastorage.net/
      > >
      > > PHP Classes - Free ready to use OOP components written in PHP
      > > http://www.phpclasses.org/
      >
    • operationsengineer1@yahoo.com
      ... Sheckar, Do you want something like this (for radio buttons, in this case?)? $tc_var = $get_var_from_somewhere; $form- AddInput(array( TYPE = radio ,
      Message 2 of 23 , Apr 6, 2006
        --- "Shekar C. Reddy" <powerobject@...> wrote:

        > Well! It's the same concept we use in client/server
        > apps where we
        > provide initial/default values for fields in insert
        > mode for user-
        > friendliness so the user does not have to key-in
        > values if they are
        > acceptable to the user.
        >
        >
        >
        > --- In forms-dev@yahoogroups.com, "Shekar C. Reddy"
        > <powerobject@...> wrote:
        >
        > Manuel,
        >
        > I guess I wasn't clear. I always call
        > LoadInputValues() with the
        > boolean whether the form is submitted or not.
        > Currently, the
        > form_class is doing the right thing. But I'm
        > searching if there is a
        > technique to assigning user-friendly initial values
        > to inputs (any
        > inputs; not just checkboxes) that get populated into
        > the Changes
        > array when submitted. When I assign a VALUE to an
        > input (to serve as
        > a default value to pre-fill a field so the user does
        > not have to key-
        > in the value) and the user submits the form
        > accepting the default
        > value as-is, the Changes array does not get
        > populated with the field
        > and its (default) value because the value is the
        > 'same' as before
        > and did not 'change'.
        >
        > Something on the lines of VALUE-vs-DefaultValue.
        >
        > Eg for a checkbox:
        >
        > VALUE =( self::$new ? 0 : $data[ 'value' ] )
        > DefaultValue =1 (used only in insert-mode)
        >
        > However, if I pre-fill:
        > VALUE =( self::$new ? 1 : $data[ 'value' ] )
        >
        > it does not get populated into Changes array if the
        > user accepts the
        > pre-filled value and submits the form because the
        > value is the same
        > as it was before and did not change.

        Sheckar,

        Do you want something like this (for radio buttons, in
        this case?)?

        $tc_var = $get_var_from_somewhere;

        $form->AddInput(array(
        'TYPE'=>'radio',
        'NAME'=>'ant',
        'ID'=>'ant1',
        'VALUE'=>'0x00',
        'CLASS'=>'radio_input',
        'ReadOnlyMark'=>'[X]',
        'LABEL'=>'Ant 1',
        'LabelCLASS'=>'radio_label',
        'TABINDEX'=>3,
        ));
        //normal and mil_std ids
        $form->AddInput(array(
        'TYPE'=>'radio',
        'NAME'=>'ant',
        'VALUE'=>'0x01',
        'ID'=>'ant2',
        'CLASS'=>'radio_input',
        'ReadOnlyMark'=>'[X]',
        'LABEL'=>'Ant 2',
        'LabelCLASS'=>'radio_label',
        'TABINDEX'=>4,
        ));

        if ($tc_var==0){
        $form->SetCheckedState('ant1', 1);
        }

        elseif ($tc_var==1){
        $form->SetCheckedState('ant2', 1);
        }

        else{
        // put in error message
        }

        this works perfect for my radio buttons. it is
        supposed to work for checkboxes, too.

        i think SetSelectOptions is similar for Select boxes
        (in my case, a pull down box), but I can't get it to
        work. I think I'm following the directions per the
        code in my last post, but i'm getting something wrong.

        best.

        oe1

        __________________________________________________
        Do You Yahoo!?
        Tired of spam? Yahoo! Mail has the best spam protection around
        http://mail.yahoo.com
      • Shekar C. Reddy
        oe, It could be any type of input - not just checkboxes/radios. For instance: TYPE = text , NAME = salutation , VALUE = (self::$new, ,
        Message 3 of 23 , Apr 6, 2006
          oe,

          It could be any type of input - not just checkboxes/radios. For
          instance:

          'TYPE' => 'text',
          'NAME' => 'salutation',
          'VALUE => (self::$new, '', $data['salutation']),

          gives the user an empty field in insert-mode. However:

          'TYPE' => 'text',
          'NAME' => 'salutation',
          'VALUE => (self::$new, 'Mr.', $data['salutation']),

          renders form with 'Mr.' as initial value in salutation input in
          insert mode (we do this in client/server apps). However, if the user
          accepts the value as-is and submits the form, this does not populate
          the Changes array because it is the same value as when the form was
          rendered. I was searching for some technique that would populate the
          default value accepted/submitted by the user into the Changes array.
          Having default for table-columns is not an option in all situations.
          I cannot query the $_POST with the hard-coded column names because
          this functionality has to go into the ancestor class in a generic
          way.

          Thanks,




          --- In forms-dev@yahoogroups.com, <operationsengineer1@...> wrote:
          >
          > --- "Shekar C. Reddy" <powerobject@...> wrote:
          >
          > > Well! It's the same concept we use in client/server
          > > apps where we
          > > provide initial/default values for fields in insert
          > > mode for user-
          > > friendliness so the user does not have to key-in
          > > values if they are
          > > acceptable to the user.
          > >
          > >
          > >
          > > --- In forms-dev@yahoogroups.com, "Shekar C. Reddy"
          > > <powerobject@> wrote:
          > >
          > > Manuel,
          > >
          > > I guess I wasn't clear. I always call
          > > LoadInputValues() with the
          > > boolean whether the form is submitted or not.
          > > Currently, the
          > > form_class is doing the right thing. But I'm
          > > searching if there is a
          > > technique to assigning user-friendly initial values
          > > to inputs (any
          > > inputs; not just checkboxes) that get populated into
          > > the Changes
          > > array when submitted. When I assign a VALUE to an
          > > input (to serve as
          > > a default value to pre-fill a field so the user does
          > > not have to key-
          > > in the value) and the user submits the form
          > > accepting the default
          > > value as-is, the Changes array does not get
          > > populated with the field
          > > and its (default) value because the value is the
          > > 'same' as before
          > > and did not 'change'.
          > >
          > > Something on the lines of VALUE-vs-DefaultValue.
          > >
          > > Eg for a checkbox:
          > >
          > > VALUE =( self::$new ? 0 : $data[ 'value' ] )
          > > DefaultValue =1 (used only in insert-mode)
          > >
          > > However, if I pre-fill:
          > > VALUE =( self::$new ? 1 : $data[ 'value' ] )
          > >
          > > it does not get populated into Changes array if the
          > > user accepts the
          > > pre-filled value and submits the form because the
          > > value is the same
          > > as it was before and did not change.
          >
          > Sheckar,
          >
          > Do you want something like this (for radio buttons, in
          > this case?)?
          >
          > $tc_var = $get_var_from_somewhere;
          >
          > $form->AddInput(array(
          > 'TYPE'=>'radio',
          > 'NAME'=>'ant',
          > 'ID'=>'ant1',
          > 'VALUE'=>'0x00',
          > 'CLASS'=>'radio_input',
          > 'ReadOnlyMark'=>'[X]',
          > 'LABEL'=>'Ant 1',
          > 'LabelCLASS'=>'radio_label',
          > 'TABINDEX'=>3,
          > ));
          > //normal and mil_std ids
          > $form->AddInput(array(
          > 'TYPE'=>'radio',
          > 'NAME'=>'ant',
          > 'VALUE'=>'0x01',
          > 'ID'=>'ant2',
          > 'CLASS'=>'radio_input',
          > 'ReadOnlyMark'=>'[X]',
          > 'LABEL'=>'Ant 2',
          > 'LabelCLASS'=>'radio_label',
          > 'TABINDEX'=>4,
          > ));
          >
          > if ($tc_var==0){
          > $form->SetCheckedState('ant1', 1);
          > }
          >
          > elseif ($tc_var==1){
          > $form->SetCheckedState('ant2', 1);
          > }
          >
          > else{
          > // put in error message
          > }
          >
          > this works perfect for my radio buttons. it is
          > supposed to work for checkboxes, too.
          >
          > i think SetSelectOptions is similar for Select boxes
          > (in my case, a pull down box), but I can't get it to
          > work. I think I'm following the directions per the
          > code in my last post, but i'm getting something wrong.
          >
          > best.
          >
          > oe1
        • operationsengineer1@yahoo.com
          ... Shekar, you are okay with radio buttons and checkboxes, right? i don t know how to get this functionality in other elements. i m still trying to figure
          Message 4 of 23 , Apr 7, 2006
            > oe,
            >
            > It could be any type of input - not just
            > checkboxes/radios.

            Shekar, you are okay with radio buttons and
            checkboxes, right? i don't know how to get this
            functionality in other elements.

            i'm still trying to figure out how to get a value
            (variable, depending on input from another
            application) highlighted and displayed by default is a
            drop down select box. basically, this would work
            exactly like the radio button - except applied to
            select boxes.

            if you've ever done this, i'd sure appreciate some
            example code.

            i have a project with a deadline and this is holding
            me up.

            tia...

            __________________________________________________
            Do You Yahoo!?
            Tired of spam? Yahoo! Mail has the best spam protection around
            http://mail.yahoo.com
          • Albert Padley
            Here s how I do it. $form- AddInput(array( TYPE = select , NAME = color , ID = color , VALUE = $_POST[ color ], SELECTED = $_POST[ color ], SIZE = 1,
            Message 5 of 23 , Apr 7, 2006
              Here's how I do it.

              $form->AddInput(array(
              "TYPE"=>"select",
              "NAME"=>"color",
              "ID"=>"color",
              "VALUE"=>$_POST['color'],
              "SELECTED"=>$_POST['color'],
              "SIZE"=>1,
              "OPTIONS"=>array(
              "1"=>"Red",
              "2"=>"Green",
              "3"=>"Yellow",
              "4"=>"Blue",
              "5"=>"Black",
              "6"=>"White",
              "7"=>"Purple"
              ),
              "LABEL"=>"Color"
              ));

              Is that what you're looking for?

              Albert Padley



              On Apr 7, 2006, at 2:15 PM, <operationsengineer1@...>
              <operationsengineer1@...> wrote:

              >> oe,
              >>
              >> It could be any type of input - not just
              >> checkboxes/radios.
              >
              > Shekar, you are okay with radio buttons and
              > checkboxes, right? i don't know how to get this
              > functionality in other elements.
              >
              > i'm still trying to figure out how to get a value
              > (variable, depending on input from another
              > application) highlighted and displayed by default is a
              > drop down select box. basically, this would work
              > exactly like the radio button - except applied to
              > select boxes.
              >
              > if you've ever done this, i'd sure appreciate some
              > example code.
              >
              > i have a project with a deadline and this is holding
              > me up.
              >
              > tia...
              >
              > __________________________________________________
              > Do You Yahoo!?
              > Tired of spam? Yahoo! Mail has the best spam protection around
              > http://mail.yahoo.com
              >
              >
              >
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
            • operationsengineer1@yahoo.com
              ... Albert, works perfectly - now i can enjoy my weekend. well, sort of - i have to do lots of tax stuff. but i can enjoy it more than i would have! thanks
              Message 6 of 23 , Apr 7, 2006
                --- Albert Padley <apadley@...> wrote:

                > Here's how I do it.
                >
                > $form->AddInput(array(
                > "TYPE"=>"select",
                > "NAME"=>"color",
                > "ID"=>"color",
                > "VALUE"=>$_POST['color'],
                > "SELECTED"=>$_POST['color'],
                > "SIZE"=>1,
                > "OPTIONS"=>array(
                > "1"=>"Red",
                > "2"=>"Green",
                > "3"=>"Yellow",
                > "4"=>"Blue",
                > "5"=>"Black",
                > "6"=>"White",
                > "7"=>"Purple"
                > ),
                > "LABEL"=>"Color"
                > ));
                >
                > Is that what you're looking for?
                >
                > Albert Padley

                Albert, works perfectly - now i can enjoy my weekend.
                well, sort of - i have to do lots of tax stuff. but i
                can enjoy it more than i would have!

                thanks again.

                __________________________________________________
                Do You Yahoo!?
                Tired of spam? Yahoo! Mail has the best spam protection around
                http://mail.yahoo.com
              • Shekar C. Reddy
                Sorry! I was away from my machine. Glad that your code now works.
                Message 7 of 23 , Apr 9, 2006
                  Sorry! I was away from my machine. Glad that your code now works.


                  --- In forms-dev@yahoogroups.com, <operationsengineer1@...> wrote:
                  >
                  > --- Albert Padley <apadley@...> wrote:
                  >
                  > > Here's how I do it.
                  > >
                  > > $form->AddInput(array(
                  > > "TYPE"=>"select",
                  > > "NAME"=>"color",
                  > > "ID"=>"color",
                  > > "VALUE"=>$_POST['color'],
                  > > "SELECTED"=>$_POST['color'],
                  > > "SIZE"=>1,
                  > > "OPTIONS"=>array(
                  > > "1"=>"Red",
                  > > "2"=>"Green",
                  > > "3"=>"Yellow",
                  > > "4"=>"Blue",
                  > > "5"=>"Black",
                  > > "6"=>"White",
                  > > "7"=>"Purple"
                  > > ),
                  > > "LABEL"=>"Color"
                  > > ));
                  > >
                  > > Is that what you're looking for?
                  > >
                  > > Albert Padley
                  >
                  > Albert, works perfectly - now i can enjoy my weekend.
                  > well, sort of - i have to do lots of tax stuff. but i
                  > can enjoy it more than i would have!
                  >
                  > thanks again.
                  >
                  > __________________________________________________
                  > Do You Yahoo!?
                  > Tired of spam? Yahoo! Mail has the best spam protection around
                  > http://mail.yahoo.com
                  >
                • operationsengineer1@yahoo.com
                  ... Sheckar, thanks. we stil have a problem, right? how to make text boxes fill in with a default value that will yield a result when submitted - or have you
                  Message 8 of 23 , Apr 9, 2006
                    --- "Shekar C. Reddy" <powerobject@...> wrote:

                    > Sorry! I was away from my machine. Glad that your
                    > code now works.

                    Sheckar, thanks. we stil have a problem, right?

                    how to make text boxes fill in with a default value
                    that will yield a result when submitted - or have you
                    figured out how to do that?


                    __________________________________________________
                    Do You Yahoo!?
                    Tired of spam? Yahoo! Mail has the best spam protection around
                    http://mail.yahoo.com
                  • Shekar C. Reddy
                    Nope. I was guessing Manuel would incorporate a new DefaultValue attribute. I guess this was already discussed similarly as possible using JavaScript (ref:
                    Message 9 of 23 , Apr 10, 2006
                      Nope. I was guessing Manuel would incorporate a new 'DefaultValue'
                      attribute. I guess this was already discussed similarly as possible
                      using JavaScript (ref: content indicative values) but doing it for
                      every input might be redundant.

                      This would add greatly to the user-friendliness of our applications.

                      Thanks,



                      --- In forms-dev@yahoogroups.com, <operationsengineer1@...> wrote:
                      >
                      > --- "Shekar C. Reddy" <powerobject@...> wrote:
                      >
                      > > Sorry! I was away from my machine. Glad that your
                      > > code now works.
                      >
                      > Sheckar, thanks. we stil have a problem, right?
                      >
                      > how to make text boxes fill in with a default value
                      > that will yield a result when submitted - or have you
                      > figured out how to do that?
                    • operationsengineer1@yahoo.com
                      ... i haven t had a need for this functionality yet, but i can sure see why it might be a nice usability feature in some applications. javascript solutions are
                      Message 10 of 23 , Apr 10, 2006
                        > Nope. I was guessing Manuel would incorporate a new
                        > 'DefaultValue'
                        > attribute. I guess this was already discussed
                        > similarly as possible
                        > using JavaScript (ref: content indicative values)
                        > but doing it for
                        > every input might be redundant.
                        >
                        > This would add greatly to the user-friendliness of
                        > our applications.
                        >
                        > Thanks,

                        i haven't had a need for this functionality yet, but i
                        can sure see why it might be a nice usability feature
                        in some applications.

                        javascript solutions are okay as long as you can
                        control the browser being used to interface the
                        application. Otherwise, it isn't a 100% solution.

                        i wish i was more experienced in php programming and
                        had more time (tax and work time are sucking life from
                        my bones right now) because it would be a neat project
                        to try and implement something like this in the forms
                        class - possibly as an add on module.

                        __________________________________________________
                        Do You Yahoo!?
                        Tired of spam? Yahoo! Mail has the best spam protection around
                        http://mail.yahoo.com
                      • Shekar C. Reddy
                        Well! Basically, the psuedo code goes something similar on the following lines: LoadInputValues ... if $submittedValue != $inputValue // User changed
                        Message 11 of 23 , Apr 10, 2006
                          Well! Basically, the psuedo code goes something similar on the
                          following lines:

                          LoadInputValues
                          ---------------
                          if $submittedValue != $inputValue // User changed value
                          populate changes array with the $submittedValue
                          else
                          if 'DefaultValue' is set and true // User accepted default value
                          populate changes array with the $submittedValue

                          As per the above, DefaultValue can just be a boolean. For instance:

                          'TYPE' => 'text',
                          'NAME' => 'salutation',
                          'VALUE => (self::$new, 'Mr.', $data['salutation']),
                          'DefaultValue' => self::$new,
                          ...



                          --- In forms-dev@yahoogroups.com, <operationsengineer1@...> wrote:
                          >
                          > > Nope. I was guessing Manuel would incorporate a new
                          > > 'DefaultValue'
                          > > attribute. I guess this was already discussed
                          > > similarly as possible
                          > > using JavaScript (ref: content indicative values)
                          > > but doing it for
                          > > every input might be redundant.
                          > >
                          > > This would add greatly to the user-friendliness of
                          > > our applications.
                          > >
                          > > Thanks,
                          >
                          > i haven't had a need for this functionality yet, but i
                          > can sure see why it might be a nice usability feature
                          > in some applications.
                          >
                          > javascript solutions are okay as long as you can
                          > control the browser being used to interface the
                          > application. Otherwise, it isn't a 100% solution.
                          >
                          > i wish i was more experienced in php programming and
                          > had more time (tax and work time are sucking life from
                          > my bones right now) because it would be a neat project
                          > to try and implement something like this in the forms
                          > class - possibly as an add on module.
                        • Manuel Lemos
                          Hello, ... Do you want the LoadInputValues function to set the Changes array for an input that is set to your initial default value? The way I see it, in that
                          Message 12 of 23 , Apr 14, 2006
                            Hello,

                            on 04/06/2006 06:08 AM Shekar C. Reddy said the following:
                            > Manuel,
                            >
                            > I guess I wasn't clear. I always call LoadInputValues() with the
                            > boolean whether the form is submitted or not. Currently, the
                            > form_class is doing the right thing. But I'm searching if there is a
                            > technique to assigning user-friendly initial values to inputs (any
                            > inputs; not just checkboxes) that get populated into the Changes
                            > array when submitted. When I assign a VALUE to an input (to serve as
                            > a default value to pre-fill a field so the user does not have to key-
                            > in the value) and the user submits the form accepting the default
                            > value as-is, the Changes array does not get populated with the field
                            > and its (default) value because the value is the 'same' as before
                            > and did not 'change'.
                            >
                            > Something on the lines of VALUE-vs-DEFAULT_VALUE.
                            >
                            > Eg for a checkbox:
                            >
                            > VALUE => ( self::$new ? 0 : $data[ 'value' ] )
                            > DEFAULT_VALUE => 1 (used only in insert-mode)
                            >
                            > However, if I pre-fill:
                            > VALUE => ( self::$new ? 1 : $data[ 'value' ] )
                            >
                            > it does not get populated into Changes array if the user accepts the
                            > pre-filled value and submits the form because the value is the same
                            > as it was before and did not change.

                            Do you want the LoadInputValues function to set the Changes array for an
                            input that is set to your initial default value?

                            The way I see it, in that case the Changes array is always set. So, you
                            won't know if the user changed the input or not.

                            If you want to pick the value regardless whether the user changed the
                            value or not, what do you want the Changes array for?

                            Why don't you just pick the value with GetInputValue?


                            --

                            Regards,
                            Manuel Lemos

                            Metastorage - Data object relational mapping layer generator
                            http://www.metastorage.net/

                            PHP Classes - Free ready to use OOP components written in PHP
                            http://www.phpclasses.org/
                          • Shekar C. Reddy
                            Manuel, I thought we could make the changes array pick values selectively for some fields (not all) on setting their new DefaultValue attribute or
                            Message 13 of 23 , Apr 14, 2006
                              Manuel,

                              I thought we could make the changes array pick values 'selectively'
                              for some fields (not all) on setting their new 'DefaultValue'
                              attribute or something. I thought of some psuedo code that goes
                              something similar on the following lines:

                              LoadInputValues
                              ---------------
                              if $submittedValue != $inputValue // User changed value
                              populate changes array with the $submittedValue
                              else
                              if 'DefaultValue' is set and true // User accepted default
                              value
                              populate changes array with the $submittedValue

                              As per the above, DefaultValue can just be a boolean. For instance:

                              'TYPE' => 'text',
                              'NAME' => 'salutation',
                              'VALUE => ( $new, 'Mr.', $data['salutation']),
                              'DefaultValue' => $new,
                              ...


                              My ancestor class relies on the Changes array to update the db and
                              so far I could not figure out a way to generically implement
                              GetInputValues() in the ancestor class for some selective fields for
                              each form dynamically in the descendents. I guess our form_class
                              discards all unknown attributes such as 'DefaultValue' during
                              AddInput() - effectively losing our settings.

                              Regards,




                              --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@...> wrote:
                              >
                              > Hello,
                              >
                              > on 04/06/2006 06:08 AM Shekar C. Reddy said the following:
                              > > Manuel,
                              > >
                              > > I guess I wasn't clear. I always call LoadInputValues() with the
                              > > boolean whether the form is submitted or not. Currently, the
                              > > form_class is doing the right thing. But I'm searching if there
                              is a
                              > > technique to assigning user-friendly initial values to inputs
                              (any
                              > > inputs; not just checkboxes) that get populated into the Changes
                              > > array when submitted. When I assign a VALUE to an input (to
                              serve as
                              > > a default value to pre-fill a field so the user does not have to
                              key-
                              > > in the value) and the user submits the form accepting the
                              default
                              > > value as-is, the Changes array does not get populated with the
                              field
                              > > and its (default) value because the value is the 'same' as
                              before
                              > > and did not 'change'.
                              > >
                              > > Something on the lines of VALUE-vs-DEFAULT_VALUE.
                              > >
                              > > Eg for a checkbox:
                              > >
                              > > VALUE => ( self::$new ? 0 : $data[ 'value' ] )
                              > > DEFAULT_VALUE => 1 (used only in insert-mode)
                              > >
                              > > However, if I pre-fill:
                              > > VALUE => ( self::$new ? 1 : $data[ 'value' ] )
                              > >
                              > > it does not get populated into Changes array if the user accepts
                              the
                              > > pre-filled value and submits the form because the value is the
                              same
                              > > as it was before and did not change.
                              >
                              > Do you want the LoadInputValues function to set the Changes array
                              for an
                              > input that is set to your initial default value?
                              >
                              > The way I see it, in that case the Changes array is always set.
                              So, you
                              > won't know if the user changed the input or not.
                              >
                              > If you want to pick the value regardless whether the user changed
                              the
                              > value or not, what do you want the Changes array for?
                              >
                              > Why don't you just pick the value with GetInputValue?
                              >
                              >
                              > --
                              >
                              > Regards,
                              > Manuel Lemos
                              >
                              > Metastorage - Data object relational mapping layer generator
                              > http://www.metastorage.net/
                              >
                              > PHP Classes - Free ready to use OOP components written in PHP
                              > http://www.phpclasses.org/
                              >
                            • Shekar C. Reddy
                              Is it possible to store any additional attributes that we set during AddInput() in the inputs array as-is and not discard them? Please see below... ... wrote:
                              Message 14 of 23 , Apr 15, 2006
                                Is it possible to store any additional attributes that we set during
                                AddInput() in the inputs array as-is and not discard them? Please
                                see below...




                                --- In forms-dev@yahoogroups.com, "Shekar C. Reddy" <zendfw@...>
                                wrote:
                                Manuel,

                                I thought we could make the changes array pick values 'selectively'
                                for some fields (not all) on setting their new 'DefaultValue'
                                attribute or something. I thought of some psuedo code that goes
                                something similar on the following lines:

                                LoadInputValues
                                ---------------
                                if $submittedValue != $inputValue // User changed value
                                populate changes array with the $submittedValue
                                else
                                if 'DefaultValue' is set and true // User accepted default
                                value
                                populate changes array with the $submittedValue

                                As per the above, DefaultValue can just be a boolean. For instance:

                                'TYPE' => 'text',
                                'NAME' => 'salutation',
                                'VALUE => ( $new, 'Mr.', $data['salutation']),
                                'DefaultValue' => $new,
                                ...


                                My ancestor class relies on the Changes array to update the db and
                                so far I could not figure out a way to generically implement
                                GetInputValues() in the ancestor class for some selective fields for
                                each form dynamically in the descendents. I guess our form_class
                                discards all unknown attributes such as 'DefaultValue' during
                                AddInput() - effectively losing our settings.

                                Regards,




                                > --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@> wrote:
                                > >
                                > > Hello,
                                > >
                                > > on 04/06/2006 06:08 AM Shekar C. Reddy said the following:
                                > > > Manuel,
                                > > >
                                > > > I guess I wasn't clear. I always call LoadInputValues() with
                                the
                                > > > boolean whether the form is submitted or not. Currently, the
                                > > > form_class is doing the right thing. But I'm searching if
                                there
                                > is a
                                > > > technique to assigning user-friendly initial values to inputs
                                > (any
                                > > > inputs; not just checkboxes) that get populated into the
                                Changes
                                > > > array when submitted. When I assign a VALUE to an input (to
                                > serve as
                                > > > a default value to pre-fill a field so the user does not have
                                to
                                > key-
                                > > > in the value) and the user submits the form accepting the
                                > default
                                > > > value as-is, the Changes array does not get populated with the
                                > field
                                > > > and its (default) value because the value is the 'same' as
                                > before
                                > > > and did not 'change'.
                                > > >
                                > > > Something on the lines of VALUE-vs-DEFAULT_VALUE.
                                > > >
                                > > > Eg for a checkbox:
                                > > >
                                > > > VALUE => ( self::$new ? 0 : $data[ 'value' ] )
                                > > > DEFAULT_VALUE => 1 (used only in insert-mode)
                                > > >
                                > > > However, if I pre-fill:
                                > > > VALUE => ( self::$new ? 1 : $data[ 'value' ] )
                                > > >
                                > > > it does not get populated into Changes array if the user
                                accepts
                                > the
                                > > > pre-filled value and submits the form because the value is the
                                > same
                                > > > as it was before and did not change.
                                > >
                                > > Do you want the LoadInputValues function to set the Changes
                                array
                                > for an
                                > > input that is set to your initial default value?
                                > >
                                > > The way I see it, in that case the Changes array is always set.
                                > So, you
                                > > won't know if the user changed the input or not.
                                > >
                                > > If you want to pick the value regardless whether the user
                                changed
                                > the
                                > > value or not, what do you want the Changes array for?
                                > >
                                > > Why don't you just pick the value with GetInputValue?
                                > >
                                > >
                                > > --
                                > >
                                > > Regards,
                                > > Manuel Lemos
                                > >
                                > > Metastorage - Data object relational mapping layer generator
                                > > http://www.metastorage.net/
                                > >
                                > > PHP Classes - Free ready to use OOP components written in PHP
                                > > http://www.phpclasses.org/
                                > >
                                >
                              • Manuel Lemos
                                Hello, ... I think you are misunderstanding the point of the Changes array. It stores initial value, not the submitted value. The submitted value you can get
                                Message 15 of 23 , Apr 17, 2006
                                  Hello,

                                  on 04/15/2006 03:56 AM Shekar C. Reddy said the following:
                                  > Manuel,
                                  >
                                  > I thought we could make the changes array pick values 'selectively'
                                  > for some fields (not all) on setting their new 'DefaultValue'
                                  > attribute or something. I thought of some psuedo code that goes
                                  > something similar on the following lines:
                                  >
                                  > LoadInputValues
                                  > ---------------
                                  > if $submittedValue != $inputValue // User changed value
                                  > populate changes array with the $submittedValue
                                  > else
                                  > if 'DefaultValue' is set and true // User accepted default
                                  > value
                                  > populate changes array with the $submittedValue

                                  I think you are misunderstanding the point of the Changes array. It
                                  stores initial value, not the submitted value. The submitted value you
                                  can get with GetInputValue. The changes array keeps the old value
                                  because it would be lost otherwise.

                                  Anyway, I think you are complicating your own purposes. Instead of
                                  getting the new value this way:

                                  $form->Changes['someinput']

                                  you can get it:

                                  $form->GetInputValue('someinput')

                                  It is almost the same syntax.


                                  > My ancestor class relies on the Changes array to update the db and
                                  > so far I could not figure out a way to generically implement
                                  > GetInputValues() in the ancestor class for some selective fields for
                                  > each form dynamically in the descendents. I guess our form_class
                                  > discards all unknown attributes such as 'DefaultValue' during
                                  > AddInput() - effectively losing our settings.

                                  All you need to do is:

                                  $form->LoadInputValues();

                                  $form->Validate();

                                  ...

                                  if(IsSet($form->Changes['someinput']))

                                  $update_query.="somefield=".$form->GetInputValue('someinput');

                                  Anyway, you do not need to reinvent the wheel. This class already
                                  integrates database inserts and updates with the forms class:

                                  http://www.phpclasses.org/databaseaccess



                                  --

                                  Regards,
                                  Manuel Lemos

                                  Metastorage - Data object relational mapping layer generator
                                  http://www.metastorage.net/

                                  PHP Classes - Free ready to use OOP components written in PHP
                                  http://www.phpclasses.org/
                                • Manuel Lemos
                                  Hello, ... No, it only stores extra HTML attributes with ExtraAttributes. -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator
                                  Message 16 of 23 , Apr 17, 2006
                                    Hello,

                                    on 04/15/2006 04:04 AM Shekar C. Reddy said the following:
                                    > Is it possible to store any additional attributes that we set during
                                    > AddInput() in the inputs array as-is and not discard them? Please
                                    > see below...

                                    No, it only stores extra HTML attributes with ExtraAttributes.

                                    --

                                    Regards,
                                    Manuel Lemos

                                    Metastorage - Data object relational mapping layer generator
                                    http://www.metastorage.net/

                                    PHP Classes - Free ready to use OOP components written in PHP
                                    http://www.phpclasses.org/
                                  • Shekar C. Reddy
                                    Manuel, Here is my situation: $new = true; $data[ salutation ] = Esquire ; // AddInput( TYPE = text , NAME = salutation , VALUE = ( $new ?
                                    Message 17 of 23 , Apr 18, 2006
                                      Manuel,

                                      Here is my situation:

                                      $new = true;
                                      $data[ 'salutation' ] = 'Esquire';
                                      //
                                      AddInput(
                                      'TYPE' => 'text',
                                      'NAME' => 'salutation',
                                      'VALUE' => ( $new ? 'Mr.' : $data[ 'salutation' ] ),
                                      'LABEL' => 'Salutation' );
                                      //
                                      AddInput( [Submit button] );

                                      If I render the above form in insert mode, the form rendered as:

                                      ---------------------------
                                      Salutation: [Mr. ]

                                      [Submit]
                                      ---------------------------

                                      Now, if I just click the submit button without changing anything
                                      (accepting the initial value: Mr.), the Changes array does 'not' get
                                      populated with the initial value of the salutation field because the
                                      value is the same when the form was submitted as before and nothing
                                      really changed. This is ok (!) because the form class does not know
                                      if the form is in insert or edit mode and it has nothing to do with
                                      the current mode. But what I'm looking for is something similar to
                                      setting a default/initial value for 'individual' fields that gets
                                      saved when the user accepts it as-is (similar to desktop apps).

                                      I mentioned submittedValue earlier through oversight. Here is the
                                      corrected psuedo-code:

                                      LoadInputValues
                                      ---------------
                                      if $submittedValue != $initialValue // User changed value
                                      populate changes array with the $initialValue
                                      else // No changes made to the value
                                      if 'DefaultValue' is set and true // User accepted default
                                      value
                                      populate changes array with the $initialValue


                                      If we can incorporate a DefaultValue attribute to AddInput():

                                      AddInput(
                                      'TYPE' => 'text',
                                      'NAME' => 'salutation',
                                      'VALUE' => ( $new ? 'Mr.' : $data[ 'salutation' ] ),
                                      'DefaultValue' => $new,
                                      'LABEL' => 'Salutation' )

                                      I guess the above logic would populate the Changes array with the
                                      initial value of the fields that have their DefaultValue attribute
                                      set to true.

                                      On another note, if I add an input as above with the 'DefaultValue'
                                      as an additional attribute (not ExtraAttributes) for my own purpose
                                      (later in the extension), the DefaultValue element is not getting
                                      stored along with the input in the form class. Form class is storing
                                      only the 'known' attributes and discarding everything else. If
                                      adding DefaultValue logic is a lot of work for you, I can do it
                                      myself in our extension if you could not discard any additional
                                      attributes we set during AddInput(). In other words, if I add an
                                      input as above, the DefaultValue should stay (stored) along with the
                                      input so we can handle it later in our extension.

                                      I was not aware of the tight integration of form class with database
                                      access and metabase classes and am currently looking into them. Even
                                      otherwise, form class would not be able to selectively populate the
                                      Changes array with initial values of selective inputs without a new
                                      DefaultValue attribute unless I'm missing some technique to
                                      accomplish this. Most of the forms in our application have over 50
                                      fields and setting DefaultValue to some of them in insert mode would
                                      make the application more user-friendly as the users can accept them
                                      as-is without having to change their values.

                                      Regards,




                                      --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@...> wrote:
                                      >
                                      > Hello,
                                      >
                                      > on 04/15/2006 03:56 AM Shekar C. Reddy said the following:
                                      > > Manuel,
                                      > >
                                      > > I thought we could make the changes array pick
                                      values 'selectively'
                                      > > for some fields (not all) on setting their new 'DefaultValue'
                                      > > attribute or something. I thought of some psuedo code that goes
                                      > > something similar on the following lines:
                                      > >
                                      > > LoadInputValues
                                      > > ---------------
                                      > > if $submittedValue != $inputValue // User changed value
                                      > > populate changes array with the $submittedValue
                                      > > else
                                      > > if 'DefaultValue' is set and true // User accepted default
                                      > > value
                                      > > populate changes array with the $submittedValue
                                      >
                                      > I think you are misunderstanding the point of the Changes array. It
                                      > stores initial value, not the submitted value. The submitted value
                                      you
                                      > can get with GetInputValue. The changes array keeps the old value
                                      > because it would be lost otherwise.
                                      >
                                      > Anyway, I think you are complicating your own purposes. Instead of
                                      > getting the new value this way:
                                      >
                                      > $form->Changes['someinput']
                                      >
                                      > you can get it:
                                      >
                                      > $form->GetInputValue('someinput')
                                      >
                                      > It is almost the same syntax.
                                      >
                                      >
                                      > > My ancestor class relies on the Changes array to update the db
                                      and
                                      > > so far I could not figure out a way to generically implement
                                      > > GetInputValues() in the ancestor class for some selective fields
                                      for
                                      > > each form dynamically in the descendents. I guess our form_class
                                      > > discards all unknown attributes such as 'DefaultValue' during
                                      > > AddInput() - effectively losing our settings.
                                      >
                                      > All you need to do is:
                                      >
                                      > $form->LoadInputValues();
                                      >
                                      > $form->Validate();
                                      >
                                      > ...
                                      >
                                      > if(IsSet($form->Changes['someinput']))
                                      >
                                      > $update_query.="somefield=".$form->GetInputValue('someinput');
                                      >
                                      > Anyway, you do not need to reinvent the wheel. This class already
                                      > integrates database inserts and updates with the forms class:
                                      >
                                      > http://www.phpclasses.org/databaseaccess
                                      >
                                      >
                                      >
                                      > --
                                      >
                                      > Regards,
                                      > Manuel Lemos
                                      >
                                      > Metastorage - Data object relational mapping layer generator
                                      > http://www.metastorage.net/
                                      >
                                      > PHP Classes - Free ready to use OOP components written in PHP
                                      > http://www.phpclasses.org/
                                      >
                                    • Shekar C. Reddy
                                      Manuel, I guess allowing us to set additional elements during AddInput() [such as DefaultValue] would allow us to extend the class with more freedom. In
                                      Message 18 of 23 , Apr 18, 2006
                                        Manuel,

                                        I guess allowing us to set 'additional' elements during AddInput()
                                        [such as DefaultValue] would allow us to extend the class with more
                                        freedom. In other words, any element that is set by us during
                                        AddInput() should be stored along with the input without discarding
                                        it. Please see below...

                                        Thanks,




                                        --- In forms-dev@yahoogroups.com, "Shekar C. Reddy" <zendfw@...>
                                        wrote:
                                        Manuel,

                                        Here is my situation:

                                        $new = true;
                                        $data[ 'salutation' ] = 'Esquire';
                                        //
                                        AddInput(
                                        'TYPE' => 'text',
                                        'NAME' => 'salutation',
                                        'VALUE' => ( $new ? 'Mr.' : $data[ 'salutation' ] ),
                                        'LABEL' => 'Salutation' );
                                        //
                                        AddInput( [Submit button] );

                                        If I render the above form in insert mode, the form rendered as:

                                        ---------------------------
                                        Salutation: [Mr. ]

                                        [Submit]
                                        ---------------------------

                                        Now, if I just click the submit button without changing anything
                                        (accepting the initial value: Mr.), the Changes array does 'not' get
                                        populated with the initial value of the salutation field because the
                                        value is the same when the form was submitted as before and nothing
                                        really changed. This is ok (!) because the form class does not know
                                        if the form is in insert or edit mode and it has nothing to do with
                                        the current mode. But what I'm looking for is something similar to
                                        setting a default/initial value for 'individual' fields that gets
                                        saved when the user accepts it as-is (similar to desktop apps).

                                        I mentioned submittedValue earlier through oversight. Here is the
                                        corrected psuedo-code:

                                        LoadInputValues
                                        ---------------
                                        if $submittedValue != $initialValue // User changed value
                                        populate changes array with the $initialValue
                                        else // No changes made to the value
                                        if 'DefaultValue' is set and true // User accepted default
                                        value
                                        populate changes array with the $initialValue


                                        If we can incorporate a DefaultValue attribute to AddInput():

                                        AddInput(
                                        'TYPE' => 'text',
                                        'NAME' => 'salutation',
                                        'VALUE' => ( $new ? 'Mr.' : $data[ 'salutation' ] ),
                                        'DefaultValue' => $new,
                                        'LABEL' => 'Salutation' )

                                        I guess the above logic would populate the Changes array with the
                                        initial value of the fields that have their DefaultValue attribute
                                        set to true.

                                        On another note, if I add an input as above with the 'DefaultValue'
                                        as an additional attribute (not ExtraAttributes) for my own purpose
                                        (later in the extension), the DefaultValue element is not getting
                                        stored along with the input in the form class. Form class is storing
                                        only the 'known' attributes and discarding everything else. If
                                        adding DefaultValue logic is a lot of work for you, I can do it
                                        myself in our extension if you could not discard any additional
                                        attributes we set during AddInput(). In other words, if I add an
                                        input as above, the DefaultValue should stay (stored) along with the
                                        input so we can handle it later in our extension.

                                        I was not aware of the tight integration of form class with database
                                        access and metabase classes and am currently looking into them. Even
                                        otherwise, form class would not be able to selectively populate the
                                        Changes array with initial values of selective inputs without a new
                                        DefaultValue attribute unless I'm missing some technique to
                                        accomplish this. Most of the forms in our application have over 50
                                        fields and setting DefaultValue to some of them in insert mode would
                                        make the application more user-friendly as the users can accept them
                                        as-is without having to change their values.

                                        Regards,




                                        > --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@> wrote:
                                        > >
                                        > > Hello,
                                        > >
                                        > > on 04/15/2006 03:56 AM Shekar C. Reddy said the following:
                                        > > > Manuel,
                                        > > >
                                        > > > I thought we could make the changes array pick
                                        > values 'selectively'
                                        > > > for some fields (not all) on setting their new 'DefaultValue'
                                        > > > attribute or something. I thought of some psuedo code that
                                        goes
                                        > > > something similar on the following lines:
                                        > > >
                                        > > > LoadInputValues
                                        > > > ---------------
                                        > > > if $submittedValue != $inputValue // User changed value
                                        > > > populate changes array with the $submittedValue
                                        > > > else
                                        > > > if 'DefaultValue' is set and true // User accepted
                                        default
                                        > > > value
                                        > > > populate changes array with the $submittedValue
                                        > >
                                        > > I think you are misunderstanding the point of the Changes array.
                                        It
                                        > > stores initial value, not the submitted value. The submitted
                                        value
                                        > you
                                        > > can get with GetInputValue. The changes array keeps the old value
                                        > > because it would be lost otherwise.
                                        > >
                                        > > Anyway, I think you are complicating your own purposes. Instead
                                        of
                                        > > getting the new value this way:
                                        > >
                                        > > $form->Changes['someinput']
                                        > >
                                        > > you can get it:
                                        > >
                                        > > $form->GetInputValue('someinput')
                                        > >
                                        > > It is almost the same syntax.
                                        > >
                                        > >
                                        > > > My ancestor class relies on the Changes array to update the db
                                        > and
                                        > > > so far I could not figure out a way to generically implement
                                        > > > GetInputValues() in the ancestor class for some selective
                                        fields
                                        > for
                                        > > > each form dynamically in the descendents. I guess our
                                        form_class
                                        > > > discards all unknown attributes such as 'DefaultValue' during
                                        > > > AddInput() - effectively losing our settings.
                                        > >
                                        > > All you need to do is:
                                        > >
                                        > > $form->LoadInputValues();
                                        > >
                                        > > $form->Validate();
                                        > >
                                        > > ...
                                        > >
                                        > > if(IsSet($form->Changes['someinput']))
                                        > >
                                        > > $update_query.="somefield=".$form->GetInputValue('someinput');
                                        > >
                                        > > Anyway, you do not need to reinvent the wheel. This class already
                                        > > integrates database inserts and updates with the forms class:
                                        > >
                                        > > http://www.phpclasses.org/databaseaccess
                                        > >
                                        > >
                                        > >
                                        > > --
                                        > >
                                        > > Regards,
                                        > > Manuel Lemos
                                        > >
                                        > > Metastorage - Data object relational mapping layer generator
                                        > > http://www.metastorage.net/
                                        > >
                                        > > PHP Classes - Free ready to use OOP components written in PHP
                                        > > http://www.phpclasses.org/
                                      • Manuel Lemos
                                        Hello, ... I think everybody understands your situation very well because you have repeated the explanation several times. What I am trying to tell you is that
                                        Message 19 of 23 , Apr 18, 2006
                                          Hello,

                                          on 04/18/2006 01:33 PM Shekar C. Reddy said the following:
                                          > Manuel,
                                          >
                                          > Here is my situation:

                                          I think everybody understands your situation very well because you have
                                          repeated the explanation several times.

                                          What I am trying to tell you is that if you want to always save a field
                                          value with your database query regardless whether it changed or not,
                                          just use GetInputValue function to pick the submitted. You do not need
                                          to look at the Changes array for that field.


                                          > On another note, if I add an input as above with the 'DefaultValue'
                                          > as an additional attribute (not ExtraAttributes) for my own purpose
                                          > (later in the extension), the DefaultValue element is not getting
                                          > stored along with the input in the form class. Form class is storing

                                          You can create a custom input class to implement new behavior or new
                                          properties.


                                          > I was not aware of the tight integration of form class with database
                                          > access and metabase classes and am currently looking into them. Even
                                          > otherwise, form class would not be able to selectively populate the
                                          > Changes array with initial values of selective inputs without a new
                                          > DefaultValue attribute unless I'm missing some technique to
                                          > accomplish this. Most of the forms in our application have over 50
                                          > fields and setting DefaultValue to some of them in insert mode would
                                          > make the application more user-friendly as the users can accept them
                                          > as-is without having to change their values.

                                          The class that I mentioned can do that. There is a function named
                                          updateformchanges . You can specify those fields that will be saved
                                          regardless if they changed using the extrafields parameter.

                                          If you do not want to use that class, you can just preset those fields
                                          that will be saved after calling LoadInputValues like this:

                                          $form->Changes["someinput"]="";


                                          --

                                          Regards,
                                          Manuel Lemos

                                          Metastorage - Data object relational mapping layer generator
                                          http://www.metastorage.net/

                                          PHP Classes - Free ready to use OOP components written in PHP
                                          http://www.phpclasses.org/
                                        • Shekar C. Reddy
                                          Thanks. I ll look into that class. ... have ... field ... not, ... need ... the DefaultValue ... purpose ... getting ... storing ... new ... database ...
                                          Message 20 of 23 , Apr 20, 2006
                                            Thanks. I'll look into that class.



                                            --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@...> wrote:
                                            >
                                            > Hello,
                                            >
                                            > on 04/18/2006 01:33 PM Shekar C. Reddy said the following:
                                            > > Manuel,
                                            > >
                                            > > Here is my situation:
                                            >
                                            > I think everybody understands your situation very well because you
                                            have
                                            > repeated the explanation several times.
                                            >
                                            > What I am trying to tell you is that if you want to always save a
                                            field
                                            > value with your database query regardless whether it changed or
                                            not,
                                            > just use GetInputValue function to pick the submitted. You do not
                                            need
                                            > to look at the Changes array for that field.
                                            >
                                            >
                                            > > On another note, if I add an input as above with
                                            the 'DefaultValue'
                                            > > as an additional attribute (not ExtraAttributes) for my own
                                            purpose
                                            > > (later in the extension), the DefaultValue element is not
                                            getting
                                            > > stored along with the input in the form class. Form class is
                                            storing
                                            >
                                            > You can create a custom input class to implement new behavior or
                                            new
                                            > properties.
                                            >
                                            >
                                            > > I was not aware of the tight integration of form class with
                                            database
                                            > > access and metabase classes and am currently looking into them.
                                            Even
                                            > > otherwise, form class would not be able to selectively populate
                                            the
                                            > > Changes array with initial values of selective inputs without a
                                            new
                                            > > DefaultValue attribute unless I'm missing some technique to
                                            > > accomplish this. Most of the forms in our application have over
                                            50
                                            > > fields and setting DefaultValue to some of them in insert mode
                                            would
                                            > > make the application more user-friendly as the users can accept
                                            them
                                            > > as-is without having to change their values.
                                            >
                                            > The class that I mentioned can do that. There is a function named
                                            > updateformchanges . You can specify those fields that will be saved
                                            > regardless if they changed using the extrafields parameter.
                                            >
                                            > If you do not want to use that class, you can just preset those
                                            fields
                                            > that will be saved after calling LoadInputValues like this:
                                            >
                                            > $form->Changes["someinput"]="";
                                            >
                                            >
                                            > --
                                            >
                                            > Regards,
                                            > Manuel Lemos
                                            >
                                            > Metastorage - Data object relational mapping layer generator
                                            > http://www.metastorage.net/
                                            >
                                            > PHP Classes - Free ready to use OOP components written in PHP
                                            > http://www.phpclasses.org/
                                            >
                                          Your message has been successfully submitted and would be delivered to recipients shortly.