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

Client actions

Expand Messages
  • Shekar C. Reddy
    Manuel, How do I go about adding inputs (buttons, checkboxes, etc) to the form to automate client (JavaScript) actions such as check/uncheck, select/unselect,
    Message 1 of 2 , Dec 1, 2006
      Manuel,

      How do I go about adding inputs (buttons, checkboxes, etc) to the form
      to automate client (JavaScript) actions such as check/uncheck,
      select/unselect, move items up/down, move items from one list to
      another, etc? I guess the forms class already has the ability to
      handle such functionality at the frontend.

      If these are going to be plugins, could you give some hints on
      creating them?

      Thanks,
    • Manuel Lemos
      Hello, ... If you add inputs to the form dynamically using Javascript, that is no longer under the control of the form class because all happens at the browser
      Message 2 of 2 , Dec 9, 2006
        Hello,

        on 12/01/2006 10:38 PM Shekar C. Reddy said the following:
        > Manuel,
        >
        > How do I go about adding inputs (buttons, checkboxes, etc) to the form
        > to automate client (JavaScript) actions such as check/uncheck,
        > select/unselect, move items up/down, move items from one list to
        > another, etc? I guess the forms class already has the ability to
        > handle such functionality at the frontend.
        >
        > If these are going to be plugins, could you give some hints on
        > creating them?

        If you add inputs to the form dynamically using Javascript, that is no
        longer under the control of the form class because all happens at the
        browser side.

        What you can do is to develop a custom input that outputs some
        Javascript code to update a page div to add your inputs dynamically. You
        should also also output a private hidden on which you can store the
        number of inputs that you add dynamically. When you add or remove your
        inputs in Javascript, the value of the hidden input should be updated.
        Your custom input can generate all the Javascript and HTML by
        implementing the AddInputPart function.

        Then on the server side, your custom plug-in should implement the
        LoadInputValues to read the value of the hidden input and call
        AddInputPart to add as many dynamic inputs as you created. Then you can
        call LoadInputValues again to load the values of those inputs.

        This may not seem obvious right now, but once you start implementing the
        custom input class to do what you want, just let me know if you have
        questions.

        --

        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.