Announcement

Collapse
No announcement yet.

Ajax Reload date field

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ajax Reload date field

    I have field date says {BIRTH_DATE}, then I have select field {TOYS}.
    In Select field {TOYS} I have where clause and filter based on Year({BIRTH_DATE}).

    How will Ajax events handle this (reload {TOYS}), while field {BIRTH_DATE} has no Ajax activation (Only Select, Check... Has !)

  • #2
    Originally posted by lpangemanan View Post
    I have field date says {BIRTH_DATE}, then I have select field {TOYS}.
    In Select field {TOYS} I have where clause and filter based on Year({BIRTH_DATE}).

    How will Ajax events handle this (reload {TOYS}), while field {BIRTH_DATE} has no Ajax activation (Only Select, Check... Has !)
    No activation, no event no nothing I'm affraid. See answer in other thread.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Thast's the point ! now I'm stuck ! how can we create New Ajax Events for Date field where triggered on change to reload other fields (Select type)

      Comment


      • #4
        Create an ajaxevent onchange or onblur and in that event change a global variable to the select of the new toys list. In the select of the toyslist use this variable to do the right selection. After onblur/onchange do a sc_redir to itslef or sc_exit(sel) and the form will be repainted. If you think this is too difficult than you can consider creating a dropdown of birth years. Then you can scroll down to trigger the ajax event to refresh the toys list automatically.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          Thanks again for your help !

          Seems getting close, but I might missed somthing. I did try both :

          1. _onBlur of my date field I put : sc_exit(sel);
          Tested it, soon after leaving entry of date field I saw Processing Animation, but no repaint nor reload other Select field. Could be something need to add ?

          2. _onBlur of my date field I put :
          $redir_app = 'form_fi010';
          $redir_param = '';
          $redir_target = '_self';
          sc_redir($redir_app, $redir_param, $redir_target);

          Tested it, soon after leaving entry of date field, screen refresh and back to initial screen where supposed stay in Add new record mode. This is never ending loop, So after Clik on Add and enter date, soon after leaving date field its return to initial screen again, where supposed stay ini Add New Record Mode. Could I missed something here ?

          Very appreciate your help...

          Comment


          • #6
            In the past, this general approach has worked for me: in onChange ajax event of the date field, sc_set_focus(select_field) and then run the select query you would normally place in the search lookup. Hopefully it works with onBlur too without unintended effects.

            Comment


            • #7
              This is exactly what we need ! You are the best as always

              Thanks a lot !!! God Bless !!!

              Comment


              • #8
                ok this may be a long time back but i cant seem to get it working...
                am trying to load a select field (dropdown box) programatically using this:
                while(!$rs->EOF)
                {
                {g3} += (string)$rs->fields[0];
                echo "<br>". $rs->fields[0];
                $rs->MoveNext();
                }
                $rs->Close();


                a select field needs a label and a value...how do i do that?

                Comment


                • #9
                  You "can't". Select must be filled by automatic or manual lookup
                  /Giuseppe

                  Professional Scriptcase Services
                  Some Customers opinions

                  Comment


                  • #10
                    Ok, this is annoying....seriously Netmake should work on it!!

                    Comment


                    • #11
                      I think you can put your select statement in the field directly. You do not need make a WHILE.

                      Comment


                      • #12
                        I did sc_set_focus(select_field) but don't know how to refresh the select fields , how run the select query?

                        Comment

                        Working...
                        X