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

Linked Selects -> Modify input data

Expand Messages
  • Kike Becerra
    Hi Manuel... I could make linked selects to work great for a country/state form... The insertion works great, now: Suppose you Choose: Italy for countryfield
    Message 1 of 13 , Aug 27, 2005
    • 0 Attachment
      Hi Manuel...
      I could make linked selects to work great for a country/state form...
      The insertion works great, now:

      Suppose you Choose:

      Italy for countryfield
      Roma for statefield

      Then, you post form, record gets inserted, etc. but...

      ¿ What happens if you would like to mod that form ?

      What should I do or modify in the code I made to show the user which
      country/state he selected in the insertion process ?

      Thanks a lot in advance.
    • operationsengineer1@yahoo.com
      ... Kike, this wasn t directed at me, but i like to give back when i can. as i understand it, you want the user to enter the data, you want to process it and
      Message 2 of 13 , Aug 27, 2005
      • 0 Attachment
        --- Kike Becerra <qbecerra@...> wrote:

        > Hi Manuel...
        > I could make linked selects to work great for a
        > country/state form...
        > The insertion works great, now:
        >
        > Suppose you Choose:
        >
        > Italy for countryfield
        > Roma for statefield
        >
        > Then, you post form, record gets inserted, etc.
        > but...
        >
        > ¿ What happens if you would like to mod that form ?
        >
        > What should I do or modify in the code I made to
        > show the user which
        > country/state he selected in the insertion process ?
        >
        > Thanks a lot in advance.

        Kike,

        this wasn't directed at me, but i like to give back
        when i can.

        as i understand it, you want the user to enter the
        data, you want to process it and then you want to
        display the input to the user, correct?

        it will depend on your form set up. i have a logic
        page and a content page.

        i use sessions to do this (you can google php sessions
        tutorials, some are quite good). i usually do my db
        work, set my session variables and call header() to
        the same page (using a constant that i set at the top
        of my page).

        on my content page (which i include into my code page
        when i want to display something), i check if the
        session variables are set and, if so, i display them
        and then unset them so they won't display again unless
        set again. i then display the form for more data
        entry.

        i hope this helps.

        if you need specific code help, just ask. i will
        likely be able to provide it monday when i crack open
        my dev laptop again.



        ____________________________________________________
        Start your day with Yahoo! - make it your home page
        http://www.yahoo.com/r/hs
      • Manuel Lemos
        Hello, ... I am not sure what exactly do you want to do. Do you want to show an additional linked select to show the users that insert new records? -- Regards,
        Message 3 of 13 , Aug 28, 2005
        • 0 Attachment
          Hello,

          on 08/27/2005 05:00 PM Kike Becerra said the following:
          > What should I do or modify in the code I made to show the user which
          > country/state he selected in the insertion process ?

          I am not sure what exactly do you want to do.

          Do you want to show an additional linked select to show the users that
          insert new records?

          --

          Regards,
          Manuel Lemos

          PHP Classes - Free ready to use OOP components written in PHP
          http://www.phpclasses.org/

          PHP Reviews - Reviews of PHP books and other products
          http://www.phpclasses.org/reviews/

          Metastorage - Data object relational mapping layer generator
          http://www.meta-language.net/metastorage.html
        • operationsengineer1@yahoo.com
          ... Kike, i think i know why you asked the question... Manuel s test_linked_select_page.html page actually does display the results when you have Apache/PHP
          Message 4 of 13 , Aug 29, 2005
          • 0 Attachment
            --- Kike Becerra <qbecerra@...> wrote:

            > Hi Manuel...
            > I could make linked selects to work great for a
            > country/state form...
            > The insertion works great, now:
            >
            > Suppose you Choose:
            >
            > Italy for countryfield
            > Roma for statefield
            >
            > Then, you post form, record gets inserted, etc.
            > but...
            >
            > ¿ What happens if you would like to mod that form ?
            >
            > What should I do or modify in the code I made to
            > show the user which
            > country/state he selected in the insertion process ?
            >
            > Thanks a lot in advance.

            Kike,

            i think i know why you asked the question... Manuel's
            test_linked_select_page.html page actually does
            display the results when you have Apache/PHP running
            on your system. if you don't, then you see the
            javascript changes, but you won't see Manuel's answer
            page b/c you don't have Apache/PHP running on your
            system.

            Fire up Apache and PHP on your system and it should
            display the chosen results - which is what i think you
            want.

            Manuel's methodology and my methodology have some
            significant differences. based on my method, i would
            choose to use sessions as i explained earlier.

            keep in mind that Manuel is light years ahead of me
            wrt to PHP programming knowledge and experience. even
            though i use a different approach, i wouldn't be very
            far along without Manuel's generous help.

            in the end, though, it is whatever works best for you.
            try Manuel's method. try your own method. see what
            works best for your thought process.

            good luck.

            __________________________________________________
            Do You Yahoo!?
            Tired of spam? Yahoo! Mail has the best spam protection around
            http://mail.yahoo.com
          • operationsengineer1@yahoo.com
            no question this time, just want to post the code required to take the recordset and fill the three arrays used to populate the selects (using ADOdb, make
            Message 5 of 13 , Aug 30, 2005
            • 0 Attachment
              no question this time, just want to post the code
              required to take the recordset and fill the three
              arrays used to populate the selects (using ADOdb, make
              adjustments depending on what db abstraction layer or
              API you use)...

              $continent=array(''=>'Select Continent');
              $country = array('' => array(''=>'Select Country'));
              $location = array('' => array(''=>'Select Location'));

              while (!$rs_location->EOF)
              {
              $continent_id = $rs_product_sn_test->fields[0];
              $country_id = $rs_product_sn_test->fields[2];
              $location_id = $rs_product_sn_test->fields[4];

              if(!isset($continent[$continent_id]))
              {
              $continent[$continent_id]=$rs_location->fields[1];
              $country[$continent_id] = array (''=>'Choose
              Country');
              }
              if(!isset($country[$contienent_id][$country_id]))
              {

              $country[$continent_id][$country_id]=$rs_location->fields[3];
              $location[$country_id] = array (''=>'Choose
              Location');
              }

              $location[$country_id][$location_id]=$rs_location->fields[5];

              $rs_location->MoveNext();
              }

              this was a little tough to format. i also took it
              from my working model and converted it into the
              continent, country and location theme - so i hope i
              didn't make any typos.

              best of luck to any newbie trying this out.



              ____________________________________________________
              Start your day with Yahoo! - make it your home page
              http://www.yahoo.com/r/hs
            • Kike Becerra
              Hi again I ve 3 operations in my clients db: - Add - Modify - Delete If user chooses ADD, i generate the form with the linked selects. User chooses
              Message 6 of 13 , Aug 30, 2005
              • 0 Attachment
                Hi again
                I've 3 operations in my clients db:
                - Add
                - Modify
                - Delete

                If user chooses ADD, i generate the form with the linked selects.
                User chooses country=EEUU then (after 2nd select fills) he chooses
                state=Chicago and then presses add button, and info is stored in db.

                If user chooses MODIFY, then I must generate another form, with the
                difference that fields should not be blank, but filled with data from
                the record that must be modified

                So, if user originally choosed country=EEUU & state=Chicago, how could
                I do for having this automatically set in the 2 linked selects ?
                I mean: instead of seeing
                Country: -= SELECT A COUNTRY =-
                State: -= SELECT A STATE =-

                I should have
                Country: EEUU
                State: CHICAGO

                and these 2 fields should be also linked... like the form for adding a
                new record...

                Hope you've understood me, and sorry 4 my english...
                Thanks a lot for helping


                --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
                > Hello,
                >
                > on 08/27/2005 05:00 PM Kike Becerra said the following:
                > > What should I do or modify in the code I made to show the user which
                > > country/state he selected in the insertion process ?
                >
                > I am not sure what exactly do you want to do.
                >
                > Do you want to show an additional linked select to show the users that
                > insert new records?
                >
                > --
                >
                > Regards,
                > Manuel Lemos
                >
                > PHP Classes - Free ready to use OOP components written in PHP
                > http://www.phpclasses.org/
                >
                > PHP Reviews - Reviews of PHP books and other products
                > http://www.phpclasses.org/reviews/
                >
                > Metastorage - Data object relational mapping layer generator
                > http://www.meta-language.net/metastorage.html
              • Manuel Lemos
                Hello, ... You just need to set the VALUE property of each select. Each linked select input will pick the initial group from the VALUE of its predecessor. --
                Message 7 of 13 , Aug 30, 2005
                • 0 Attachment
                  Hello,

                  on 08/30/2005 09:38 PM Kike Becerra said the following:
                  > Hi again
                  > I've 3 operations in my clients db:
                  > - Add
                  > - Modify
                  > - Delete
                  >
                  > If user chooses ADD, i generate the form with the linked selects.
                  > User chooses country=EEUU then (after 2nd select fills) he chooses
                  > state=Chicago and then presses add button, and info is stored in db.
                  >
                  > If user chooses MODIFY, then I must generate another form, with the
                  > difference that fields should not be blank, but filled with data from
                  > the record that must be modified
                  >
                  > So, if user originally choosed country=EEUU & state=Chicago, how could
                  > I do for having this automatically set in the 2 linked selects ?
                  > I mean: instead of seeing
                  > Country: -= SELECT A COUNTRY =-
                  > State: -= SELECT A STATE =-
                  >
                  > I should have
                  > Country: EEUU
                  > State: CHICAGO
                  >
                  > and these 2 fields should be also linked... like the form for adding a
                  > new record...

                  You just need to set the VALUE property of each select. Each linked
                  select input will pick the initial group from the VALUE of its predecessor.

                  --

                  Regards,
                  Manuel Lemos

                  PHP Classes - Free ready to use OOP components written in PHP
                  http://www.phpclasses.org/

                  PHP Reviews - Reviews of PHP books and other products
                  http://www.phpclasses.org/reviews/

                  Metastorage - Data object relational mapping layer generator
                  http://www.meta-language.net/metastorage.html
                • Kike Becerra
                  Hi again Manuel I got your reply, and well... When user clicks modify record the form shows again, with the linked selects, all right, but well, I want to
                  Message 8 of 13 , Sep 5, 2005
                  • 0 Attachment
                    Hi again Manuel
                    I got your reply, and well...

                    When user clicks "modify record" the form shows again, with the linked
                    selects, all right, but well, I want to assign a predetermined value
                    to the select, but the VALUE property it is already assigned with this
                    code, which fills the select

                    "VALUE"=>Key($paises),

                    And I'd like to:
                    1- Fill each select
                    2- And after 1) assign a value (from its list) to each select

                    "VALUE"=>$value_user_has_in_its_record;

                    Hope you've understood my idea...

                    Thanks a lot for helping


                    --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
                    > Hello,
                    >
                    > on 08/30/2005 09:38 PM Kike Becerra said the following:
                    > > Hi again
                    > > I've 3 operations in my clients db:
                    > > - Add
                    > > - Modify
                    > > - Delete
                    > >
                    > > If user chooses ADD, i generate the form with the linked selects.
                    > > User chooses country=EEUU then (after 2nd select fills) he chooses
                    > > state=Chicago and then presses add button, and info is stored in db.
                    > >
                    > > If user chooses MODIFY, then I must generate another form, with the
                    > > difference that fields should not be blank, but filled with data from
                    > > the record that must be modified
                    > >
                    > > So, if user originally choosed country=EEUU & state=Chicago, how could
                    > > I do for having this automatically set in the 2 linked selects ?
                    > > I mean: instead of seeing
                    > > Country: -= SELECT A COUNTRY =-
                    > > State: -= SELECT A STATE =-
                    > >
                    > > I should have
                    > > Country: EEUU
                    > > State: CHICAGO
                    > >
                    > > and these 2 fields should be also linked... like the form for adding a
                    > > new record...
                    >
                    > You just need to set the VALUE property of each select. Each linked
                    > select input will pick the initial group from the VALUE of its
                    predecessor.
                    >
                    > --
                    >
                    > Regards,
                    > Manuel Lemos
                    >
                    > PHP Classes - Free ready to use OOP components written in PHP
                    > http://www.phpclasses.org/
                    >
                    > PHP Reviews - Reviews of PHP books and other products
                    > http://www.phpclasses.org/reviews/
                    >
                    > Metastorage - Data object relational mapping layer generator
                    > http://www.meta-language.net/metastorage.html
                  • Kike Becerra
                    Hi again Please ignore/delete my last message I thought the VALUE option for select was the one which served to fill the select with values, but I noticed that
                    Message 9 of 13 , Sep 5, 2005
                    • 0 Attachment
                      Hi again
                      Please ignore/delete my last message
                      I thought the VALUE option for select was the one which served to fill
                      the select with values, but I noticed that OPTIONS was really for this...
                      I assigned VALUE=>$field

                      And everything went ok

                      Thanks !!!


                      --- In forms-dev@yahoogroups.com, "Kike Becerra" <qbecerra@y...> wrote:
                      > Hi again Manuel
                      > I got your reply, and well...
                      >
                      > When user clicks "modify record" the form shows again, with the linked
                      > selects, all right, but well, I want to assign a predetermined value
                      > to the select, but the VALUE property it is already assigned with this
                      > code, which fills the select
                      >
                      > "VALUE"=>Key($paises),
                      >
                      > And I'd like to:
                      > 1- Fill each select
                      > 2- And after 1) assign a value (from its list) to each select
                      >
                      > "VALUE"=>$value_user_has_in_its_record;
                      >
                      > Hope you've understood my idea...
                      >
                      > Thanks a lot for helping
                      >
                      >
                      > --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
                      > > Hello,
                      > >
                      > > on 08/30/2005 09:38 PM Kike Becerra said the following:
                      > > > Hi again
                      > > > I've 3 operations in my clients db:
                      > > > - Add
                      > > > - Modify
                      > > > - Delete
                      > > >
                      > > > If user chooses ADD, i generate the form with the linked selects.
                      > > > User chooses country=EEUU then (after 2nd select fills) he chooses
                      > > > state=Chicago and then presses add button, and info is stored in db.
                      > > >
                      > > > If user chooses MODIFY, then I must generate another form, with the
                      > > > difference that fields should not be blank, but filled with data
                      from
                      > > > the record that must be modified
                      > > >
                      > > > So, if user originally choosed country=EEUU & state=Chicago, how
                      could
                      > > > I do for having this automatically set in the 2 linked selects ?
                      > > > I mean: instead of seeing
                      > > > Country: -= SELECT A COUNTRY =-
                      > > > State: -= SELECT A STATE =-
                      > > >
                      > > > I should have
                      > > > Country: EEUU
                      > > > State: CHICAGO
                      > > >
                      > > > and these 2 fields should be also linked... like the form for
                      adding a
                      > > > new record...
                      > >
                      > > You just need to set the VALUE property of each select. Each linked
                      > > select input will pick the initial group from the VALUE of its
                      > predecessor.
                      > >
                      > > --
                      > >
                      > > Regards,
                      > > Manuel Lemos
                      > >
                      > > PHP Classes - Free ready to use OOP components written in PHP
                      > > http://www.phpclasses.org/
                      > >
                      > > PHP Reviews - Reviews of PHP books and other products
                      > > http://www.phpclasses.org/reviews/
                      > >
                      > > Metastorage - Data object relational mapping layer generator
                      > > http://www.meta-language.net/metastorage.html
                    • Kike Becerra
                      Hi again (lol) I ve the 2 linked selects... When I modify a record, I set the value of the 1º select and it works, but when I try to assign a value to the 2º
                      Message 10 of 13 , Sep 5, 2005
                      • 0 Attachment
                        Hi again (lol)

                        I've the 2 linked selects...
                        When I modify a record, I set the value of the 1º select and it works,
                        but when I try to assign a value to the 2º select, it doesn't work...

                        What's wrong ?
                        Here i post the code for the 2º select...
                        When I see the form, the 1º select is with the corresponding option
                        selected, but the 2º select is with the 1º option..

                        $form->AddInput(array(
                        "TYPE"=>"custom",
                        "ID"=>"campoprovincia",
                        "NAME"=>"campoprovincia",
                        "LABEL"=>"Localidad: ",
                        "CustomClass"=>"form_linked_select_class",
                        "VALUE"=>$camponombreloc,
                        "SIZE"=>1,
                        "Groups"=>$provin,
                        "LinkedInput"=>"campopais",
                        "ValidateAsNotEmpty"=>1,
                        "ValidationErrorMessage"=>"Seleccione una localidad"
                        ));

                        Thanks...


                        --- In forms-dev@yahoogroups.com, "Kike Becerra" <qbecerra@y...> wrote:
                        > Hi again
                        > Please ignore/delete my last message
                        > I thought the VALUE option for select was the one which served to fill
                        > the select with values, but I noticed that OPTIONS was really for
                        this...
                        > I assigned VALUE=>$field
                        >
                        > And everything went ok
                        >
                        > Thanks !!!
                        >
                        >
                        > --- In forms-dev@yahoogroups.com, "Kike Becerra" <qbecerra@y...> wrote:
                        > > Hi again Manuel
                        > > I got your reply, and well...
                        > >
                        > > When user clicks "modify record" the form shows again, with the linked
                        > > selects, all right, but well, I want to assign a predetermined value
                        > > to the select, but the VALUE property it is already assigned with this
                        > > code, which fills the select
                        > >
                        > > "VALUE"=>Key($paises),
                        > >
                        > > And I'd like to:
                        > > 1- Fill each select
                        > > 2- And after 1) assign a value (from its list) to each select
                        > >
                        > > "VALUE"=>$value_user_has_in_its_record;
                        > >
                        > > Hope you've understood my idea...
                        > >
                        > > Thanks a lot for helping
                        > >
                        > >
                        > > --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
                        > > > Hello,
                        > > >
                        > > > on 08/30/2005 09:38 PM Kike Becerra said the following:
                        > > > > Hi again
                        > > > > I've 3 operations in my clients db:
                        > > > > - Add
                        > > > > - Modify
                        > > > > - Delete
                        > > > >
                        > > > > If user chooses ADD, i generate the form with the linked selects.
                        > > > > User chooses country=EEUU then (after 2nd select fills) he chooses
                        > > > > state=Chicago and then presses add button, and info is stored
                        in db.
                        > > > >
                        > > > > If user chooses MODIFY, then I must generate another form,
                        with the
                        > > > > difference that fields should not be blank, but filled with data
                        > from
                        > > > > the record that must be modified
                        > > > >
                        > > > > So, if user originally choosed country=EEUU & state=Chicago, how
                        > could
                        > > > > I do for having this automatically set in the 2 linked selects ?
                        > > > > I mean: instead of seeing
                        > > > > Country: -= SELECT A COUNTRY =-
                        > > > > State: -= SELECT A STATE =-
                        > > > >
                        > > > > I should have
                        > > > > Country: EEUU
                        > > > > State: CHICAGO
                        > > > >
                        > > > > and these 2 fields should be also linked... like the form for
                        > adding a
                        > > > > new record...
                        > > >
                        > > > You just need to set the VALUE property of each select. Each linked
                        > > > select input will pick the initial group from the VALUE of its
                        > > predecessor.
                        > > >
                        > > > --
                        > > >
                        > > > Regards,
                        > > > Manuel Lemos
                        > > >
                        > > > PHP Classes - Free ready to use OOP components written in PHP
                        > > > http://www.phpclasses.org/
                        > > >
                        > > > PHP Reviews - Reviews of PHP books and other products
                        > > > http://www.phpclasses.org/reviews/
                        > > >
                        > > > Metastorage - Data object relational mapping layer generator
                        > > > http://www.meta-language.net/metastorage.html
                      • operationsengineer1@yahoo.com
                        Kike, i can t help much here other to say i think this is supposed to be Manuel s answer (from prior post)... ... You just need to set the VALUE property of
                        Message 11 of 13 , Sep 7, 2005
                        • 0 Attachment
                          Kike,

                          i can't help much here other to say i think this is
                          supposed to be Manuel's answer (from prior post)...

                          ---
                          You just need to set the VALUE property of each
                          select. Each linked select input will pick the initial
                          group from the VALUE of its predecessor.
                          ---

                          i'm not working through this issue (yet!), so the
                          above doesn't make too much sense to me - especially
                          my inference that the values somehow cascade through
                          the linked selects.

                          assuming i'm understanding you correctly...

                          i assume you have variables that you use to send
                          information to your db. you could create a session
                          and pass those variables to the next page and then
                          assign the appropriate SESSION variable (used to be db
                          input variables in prior page) to the appropriate form
                          element's VALUE value.

                          the VALUE for each element should equal the entry
                          entry into the db.

                          depending on your setup you may be able to do this
                          with the POST variables.

                          --- Kike Becerra <qbecerra@...> wrote:

                          > Hi again (lol)
                          >
                          > I've the 2 linked selects...
                          > When I modify a record, I set the value of the 1º
                          > select and it works,
                          > but when I try to assign a value to the 2º select,
                          > it doesn't work...
                          >
                          > What's wrong ?
                          > Here i post the code for the 2º select...
                          > When I see the form, the 1º select is with the
                          > corresponding option
                          > selected, but the 2º select is with the 1º option..
                          >
                          > $form->AddInput(array(
                          > "TYPE"=>"custom",
                          > "ID"=>"campoprovincia",
                          > "NAME"=>"campoprovincia",
                          > "LABEL"=>"Localidad: ",
                          > "CustomClass"=>"form_linked_select_class",
                          > "VALUE"=>$camponombreloc,
                          > "SIZE"=>1,
                          > "Groups"=>$provin,
                          > "LinkedInput"=>"campopais",
                          > "ValidateAsNotEmpty"=>1,
                          > "ValidationErrorMessage"=>"Seleccione una
                          > localidad"
                          > ));
                          >
                          > Thanks...
                          >
                          >
                          > --- In forms-dev@yahoogroups.com, "Kike Becerra"
                          > <qbecerra@y...> wrote:
                          > > Hi again
                          > > Please ignore/delete my last message
                          > > I thought the VALUE option for select was the one
                          > which served to fill
                          > > the select with values, but I noticed that OPTIONS
                          > was really for
                          > this...
                          > > I assigned VALUE=>$field
                          > >
                          > > And everything went ok
                          > >
                          > > Thanks !!!
                          > >
                          > >
                          > > --- In forms-dev@yahoogroups.com, "Kike Becerra"
                          > <qbecerra@y...> wrote:
                          > > > Hi again Manuel
                          > > > I got your reply, and well...
                          > > >
                          > > > When user clicks "modify record" the form shows
                          > again, with the linked
                          > > > selects, all right, but well, I want to assign a
                          > predetermined value
                          > > > to the select, but the VALUE property it is
                          > already assigned with this
                          > > > code, which fills the select
                          > > >
                          > > > "VALUE"=>Key($paises),
                          > > >
                          > > > And I'd like to:
                          > > > 1- Fill each select
                          > > > 2- And after 1) assign a value (from its list)
                          > to each select
                          > > >
                          > > > "VALUE"=>$value_user_has_in_its_record;
                          > > >
                          > > > Hope you've understood my idea...
                          > > >
                          > > > Thanks a lot for helping
                          > > >
                          > > >
                          > > > --- In forms-dev@yahoogroups.com, Manuel Lemos
                          > <mlemos@a...> wrote:
                          > > > > Hello,
                          > > > >
                          > > > > on 08/30/2005 09:38 PM Kike Becerra said the
                          > following:
                          > > > > > Hi again
                          > > > > > I've 3 operations in my clients db:
                          > > > > > - Add
                          > > > > > - Modify
                          > > > > > - Delete
                          > > > > >
                          > > > > > If user chooses ADD, i generate the form
                          > with the linked selects.
                          > > > > > User chooses country=EEUU then (after 2nd
                          > select fills) he chooses
                          > > > > > state=Chicago and then presses add button,
                          > and info is stored
                          > in db.
                          > > > > >
                          > > > > > If user chooses MODIFY, then I must generate
                          > another form,
                          > with the
                          > > > > > difference that fields should not be blank,
                          > but filled with data
                          > > from
                          > > > > > the record that must be modified
                          > > > > >
                          > > > > > So, if user originally choosed country=EEUU
                          > & state=Chicago, how
                          > > could
                          > > > > > I do for having this automatically set in
                          > the 2 linked selects ?
                          > > > > > I mean: instead of seeing
                          > > > > > Country: -= SELECT A COUNTRY =-
                          > > > > > State: -= SELECT A STATE =-
                          > > > > >
                          > > > > > I should have
                          > > > > > Country: EEUU
                          > > > > > State: CHICAGO
                          > > > > >
                          > > > > > and these 2 fields should be also linked...
                          > like the form for
                          > > adding a
                          > > > > > new record...
                          > > > >
                          > > > > You just need to set the VALUE property of
                          > each select. Each linked
                          > > > > select input will pick the initial group from
                          > the VALUE of its
                          > > > predecessor.
                          > > > >
                          > > > > --
                          > > > >
                          > > > > Regards,
                          > > > > Manuel Lemos
                          > > > >
                          > > > > PHP Classes - Free ready to use OOP components
                          > written in PHP
                          > > > > http://www.phpclasses.org/
                          > > > >
                          > > > > PHP Reviews - Reviews of PHP books and other
                          > products
                          > > > > http://www.phpclasses.org/reviews/
                          > > > >
                          > > > > Metastorage - Data object relational mapping
                          > layer generator
                          > > > > http://www.meta-language.net/metastorage.html
                          >
                          >
                          >
                          >





                          ______________________________________________________
                          Click here to donate to the Hurricane Katrina relief effort.
                          http://store.yahoo.com/redcross-donate3/
                        • Manuel Lemos
                          Hello, ... The VALUE property must be one of the values of the group that is currently selected by the campopais field. -- Regards, Manuel Lemos PHP Classes -
                          Message 12 of 13 , Sep 7, 2005
                          • 0 Attachment
                            Hello,

                            on 09/05/2005 12:26 PM Kike Becerra said the following:
                            > I've the 2 linked selects...
                            > When I modify a record, I set the value of the 1º select and it works,
                            > but when I try to assign a value to the 2º select, it doesn't work...
                            >
                            > What's wrong ?
                            > Here i post the code for the 2º select...
                            > When I see the form, the 1º select is with the corresponding option
                            > selected, but the 2º select is with the 1º option..
                            >
                            > $form->AddInput(array(
                            > "TYPE"=>"custom",
                            > "ID"=>"campoprovincia",
                            > "NAME"=>"campoprovincia",
                            > "LABEL"=>"Localidad: ",
                            > "CustomClass"=>"form_linked_select_class",
                            > "VALUE"=>$camponombreloc,
                            > "SIZE"=>1,
                            > "Groups"=>$provin,
                            > "LinkedInput"=>"campopais",
                            > "ValidateAsNotEmpty"=>1,
                            > "ValidationErrorMessage"=>"Seleccione una localidad"
                            > ));

                            The VALUE property must be one of the values of the group that is
                            currently selected by the campopais field.


                            --

                            Regards,
                            Manuel Lemos

                            PHP Classes - Free ready to use OOP components written in PHP
                            http://www.phpclasses.org/

                            PHP Reviews - Reviews of PHP books and other products
                            http://www.phpclasses.org/reviews/

                            Metastorage - Data object relational mapping layer generator
                            http://www.meta-language.net/metastorage.html
                          • Mark Ty
                            Just want to share my experience... I have a similar set up of using add-modify. I have one PHP file that I use for BOTH add and modify. the Add works
                            Message 13 of 13 , Jul 20, 2006
                            • 0 Attachment
                              Just want to share my experience...

                              I have a similar set up of using add-modify. I have one PHP file that
                              I use for BOTH add and modify.

                              the Add works perfectly but for modify the 2nd select was not working...

                              My Logic for MODIFY is
                              if $doit
                              SQL UPDATE
                              else
                              SQL SELECT
                              SetInputValue for all fields.

                              However, I was getting something about a VALUE is not changeable error
                              message for my linked_select code:

                              $subscription->SetInputValue("secondfield", $rs->fields["secondfield"]);




                              I found that the VALUE property must be set in the AddInput method at
                              the top of the page... which at this point I don't know if i'm running
                              in ADD or Modify or if the form WasSubmitted or Validated because I'm
                              still defining the form input fields. Now remember that normally I set
                              all my values to "" and later after runnning the "WasSubmitted" and
                              the "Validate" test I set the values for all the fields.

                              So my work around is to run the SQL twice... once at the top and again
                              in my normal place at the bottom. Because this only calls one row but
                              twice, there is minimal overhead for me. It would of been "nice" and
                              "cleaner" to just set everything with the if $doit.



                              I'm just ranting... if this rant helps someone else then well and good
                              :) If my rant show's that I did it wrong or overlooked something, then
                              I'd gladly like to hear what you have to say :)
                            Your message has been successfully submitted and would be delivered to recipients shortly.