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

Back to Basics: Forms Class for Ultra-Beginners

Expand Messages
  • Gary Rametta
    Hello- I have the memory of an elephant. I ve developed web pages, but each time I start a new one it s like I ve never done one before. Anyway, the latest
    Message 1 of 4 , Jun 29, 2006
    • 0 Attachment
      Hello-
      I have the memory of an elephant. I've developed web pages, but each
      time I start a new one it's like I've never done one before. Anyway,
      the latest project I'm doing is for a nonprofit organization. One key
      area of the site is a Volunteer sign-up page. I need a way to allow
      interested visitors to give us their name and contact information,
      indicate their area of interest as a volunteer, and make a donation if
      they want to.

      I would like to use your forms class, not because I think I understand
      it or have the slightest idea of how to implement it, but because I've
      been burned before by spammers on pages that allowed users to enter
      information (think: guestbook). Your class was highly recommended on
      the PHPClasses web page and on Sitepoint.

      Do I have to completely rethink the HTML I wrote in constructing the
      page in order to use your class? I hope not. I'm pretty much thunked
      out on HTML. Basically, I have a lot of empty fields like FIRST, LAST,
      STREET ADDRESS, CITY, STATE, ZIP, EMAIL ADDRESS, AREA OF INTEREST,
      ITEMS YOU'RE DONATING, PLEDGE AMOUNT and so on.

      How do I use a class like yours? Any pointers would be genuinely
      appreciated. Sorry for my lack of knowledge in this area.
    • Manuel Lemos
      Hello, ... Not really. You can pick your HTML forms and transform them into Smarty templates with minor changes or replace the input tags by short PHP commands
      Message 2 of 4 , Jun 29, 2006
      • 0 Attachment
        Hello,

        on 06/29/2006 08:24 PM Gary Rametta said the following:
        > Do I have to completely rethink the HTML I wrote in constructing the
        > page in order to use your class? I hope not. I'm pretty much thunked
        > out on HTML. Basically, I have a lot of empty fields like FIRST, LAST,
        > STREET ADDRESS, CITY, STATE, ZIP, EMAIL ADDRESS, AREA OF INTEREST,
        > ITEMS YOU'RE DONATING, PLEDGE AMOUNT and so on.

        Not really. You can pick your HTML forms and transform them into Smarty
        templates with minor changes or replace the input tags by short PHP
        commands to specify where the your forms inputs appear in the form page.

        You also need to define the form inputs separately so the class knows
        how you want to generate the form inputs with the validation rules you need.

        Then you just tell class to render forms and it automagically will
        integrate the validation Javascript to validate the forms on the client
        side complementary to the server side validation that the class performs
        upon the validation rules that you define.

        I am also working on a separate class that will make it possible to feed
        it a plain HTML page with some forms and it will automatically collect
        the form input definitions and template layout. Just let me know if you
        would like to try that as soon it is ready to be tested.


        > How do I use a class like yours? Any pointers would be genuinely
        > appreciated. Sorry for my lack of knowledge in this area.

        I think the best way to get started is to look at the general example
        test_form.php script available in the class page:

        http://www.phpclasses.org/formsgeneration



        --

        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
        ... Gary, i think the first thing you need to do is decide what you want. i started using Manuel s great forms class when i first started seriously developing
        Message 3 of 4 , Jun 30, 2006
        • 0 Attachment
          --- Gary Rametta <grametta@...> wrote:

          > Hello-
          > I have the memory of an elephant. I've developed web
          > pages, but each
          > time I start a new one it's like I've never done one
          > before. Anyway,
          > the latest project I'm doing is for a nonprofit
          > organization. One key
          > area of the site is a Volunteer sign-up page. I need
          > a way to allow
          > interested visitors to give us their name and
          > contact information,
          > indicate their area of interest as a volunteer, and
          > make a donation if
          > they want to.
          >
          > I would like to use your forms class, not because I
          > think I understand
          > it or have the slightest idea of how to implement
          > it, but because I've
          > been burned before by spammers on pages that allowed
          > users to enter
          > information (think: guestbook). Your class was
          > highly recommended on
          > the PHPClasses web page and on Sitepoint.
          >
          > Do I have to completely rethink the HTML I wrote in
          > constructing the
          > page in order to use your class? I hope not. I'm
          > pretty much thunked
          > out on HTML. Basically, I have a lot of empty fields
          > like FIRST, LAST,
          > STREET ADDRESS, CITY, STATE, ZIP, EMAIL ADDRESS,
          > AREA OF INTEREST,
          > ITEMS YOU'RE DONATING, PLEDGE AMOUNT and so on.
          >
          > How do I use a class like yours? Any pointers would
          > be genuinely
          > appreciated. Sorry for my lack of knowledge in this
          > area.

          Gary, i think the first thing you need to do is decide
          what you want. i started using Manuel's great forms
          class when i first started seriously developing - and
          it *ISN'T* trivial to learn for a beginner.

          you can learn it - i've learned lots through
          determined effort. i'm no natural programmer, but i
          am tenacious and i do get some of the basics.

          if you want to develop a single form and be done with
          it, learning this class may be overkill.

          but... if you work with web forms on an ongoing
          basis, this class is great.

          i have a very simple form that uses Manuel's class and
          adodb.

          i will adapt it to an example and post it for your
          review - that will tell you more than anyone could
          explain in a short time.

          as an overview, though, i use a logic page
          (logic.php). it then pulls a frame template page
          (frame_logic.tpl.php) which consists of the display
          information (mostly html and css, but some php for
          display purposes). the frame then includes the
          appropriate form.

          logic.php defines some constants/variables and calls
          frame_logic.tpl.php which, in turn, calls the correct
          form elements to display (and some cool javascript
          that will put focus in the first form element).

          it will make more sense when i post the code. i will
          keep it very simple so you can focus on the basic
          process and not the trivial details.

          i might need a day or two to get it completed, though.

          __________________________________________________
          Do You Yahoo!?
          Tired of spam? Yahoo! Mail has the best spam protection around
          http://mail.yahoo.com
        • Gary Rametta
          ... Wow, thanks a million for the offer and your insights. If you have the time to work out an example and post the code, I will gladly apply myself and learn
          Message 4 of 4 , Jun 30, 2006
          • 0 Attachment
            --- In forms-dev@yahoogroups.com, <operationsengineer1@...> wrote:
            >
            > ...i have a very simple form that uses Manuel's class and
            > adodb.
            >
            > i will adapt it to an example and post it for your
            > review - that will tell you more than anyone could
            > explain in a short time.
            >
            > as an overview, though, i use a logic page
            > (logic.php). it then pulls a frame template page
            > (frame_logic.tpl.php) which consists of the display
            > information (mostly html and css, but some php for
            > display purposes). the frame then includes the
            > appropriate form.
            >
            > logic.php defines some constants/variables and calls
            > frame_logic.tpl.php which, in turn, calls the correct
            > form elements to display (and some cool javascript
            > that will put focus in the first form element).
            >
            > it will make more sense when i post the code. i will
            > keep it very simple so you can focus on the basic
            > process and not the trivial details.
            >
            > i might need a day or two to get it completed, though.
            >

            Wow, thanks a million for the offer and your insights. If you have the
            time to work out an example and post the code, I will gladly apply
            myself and learn how to use it. Not being a programmer, I've been able
            to learn what I have only by studying the work of others and adapting
            it to meet my needs. The generosity of those who make their work and
            ideas available to others is humbling and very much appreciated.

            Thanks again,
            Gary
          Your message has been successfully submitted and would be delivered to recipients shortly.