HTML - Continuous Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blyxx86
    Contributor
    • Nov 2006
    • 258

    HTML - Continuous Forms

    Good Evening Everyone,

    I'm not too sure if this can be done without some intensive coding, but what I'm looking to do is seemingly simple.

    I am creating some pages with forms and want the various levels within the form to repeat once data is entered into one line.

    For example, let's assume we have one drop box and one text field.
    Select an Item: *New Drop* Enter New Name: *Blank Field*

    However once data is entered I want another line to appear below it.
    Select an Item: *TV* Enter New Name: *Television*
    Select an Item: *New Drop* Enter New Name: *Blank Field*

    Of course this would repeat continuously. The pages are actually .php but that is serverside generation and will not know when the person has entered a value into either box. So maybe this is a job for Java? I hope not, because I don't know Java. Maybe someone can point me in the right direction? Maybe there is already code out there that will do this.

    Any help is appreciated!

    Thank you,
    Kyle
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Not Java, but JavaScript - two very different languages. So, yes, it will require JavaScript if you want to avoid a page reload.

    Comment

    • blyxx86
      Contributor
      • Nov 2006
      • 258

      #3
      Java not equal to JavaScript... Got it! That is news to me, I wonder how many times I've called it that and truly thought it was the same. I usually say Javascript when dealing with HTML but I think I was in a hurry to make the post.

      I will post in the Javascript forum (not the Java forum) to see if they can help me out there.

      Do you have any alternative suggestions to this? I've thought about just having multiple lines to start with or a drop down that allows for more lines to be added, but I was afraid of losing what information had already been typed in.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        If you want to avoid JavaScript, you can add a submit button next to the text box. The problem with this is that you'll need to submit each time you want to add a new drop down and text box.

        If you want minimal JavaScript, you can use onchange to trigger a submit.

        If you want more control and flexibility, then JavaScript is your best option.

        Comment

        • blyxx86
          Contributor
          • Nov 2006
          • 258

          #5
          Thank you for the advice!

          For now, I think I may just use the submit button idea. However, once I am able to sit down for a little while and learn the Javascript needed I will use that.

          :)

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            OK, no problem. Once you're ready and if you ever get stuck, you can post in the JavaScript forum. Good luck!

            Comment

            Working...