#1
  1. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,031
    Rep Power
    377

    Creating forms - efficient way


    So this question relates to the fact that we create forms again and again. At the moment what i have written is something like this:

    1. User goes to page, fill in fields he wants, presses submit
    2. Form fields are created for him along with javascript.
    3. he plugs in this code on his page.

    The idea is that there is one page connecting to our system behind the scenes, and instead of creating a form from scratch, then XML and then connect to our system, we can have one file that interacts with this code (generated by my script above), creates xml, connects to our system.

    The only downside is that the code generated by this script is obv. created again and again so i was just wondering if there could be a better way of doing it
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Cache the results?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,031
    Rep Power
    377
    sorry, i know i am terrible at explaining.. what I meant to say was:

    We have to create different Landing pages, most of the times the form fields are the same (for this i can create a template/cache) but other times there will be extra fields.

    The main question is that I am wondering if there is a "better" way to do things so that perhaps I can have just one form being called multiple times (in fact thinking about this, it is a simple matter of "including" the form. i.e. create the form once and then "include" it from all the landing pages.) then with the added advantage that if need be, I can add custom fields in the actual page? (sorry I am asking the question/thinking out loud)

    Just to re-cap: I have a form automation script that generates the code for the form so that it interacts with ONE backend script rather than creating a specific script for each form.
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    It sounds like you could create a generic front-end script to handle your forms. Basically, each form would be defined as a set of configuration directives, and your front-end script would process those and build the form accordingly. The most difficult part is probably analyzing your current system to determine what configuration directives are necessary.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo