Help: Make all fields in table tag required.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spanky

    #1

    Help: Make all fields in table tag required.

    I am looking for some help with the following.

    I have a form with many fields. I have a table in the form that I
    need to make all the fields within the table required. Basic
    validation, just need to make sure they are not blank.

    Here is the kicker....
    I have a javascript that adds rows and fields whenever the user clicks
    a button for add rows. So, the user clicks button and I add a row
    with about 5 fields. Every time a user clicks I add another row.

    So, when submitting the form I need to check all fields inside the
    table tag ID"TEST".

    Any help or guidance is appreciated.

    Allen
  • lallous

    #2
    Re: Make all fields in table tag required.

    Hi,

    when you dynamically add a new input field in the form, do name it as:
    MyFieldN
    where N ranges fron say 0 to limit.

    Later run a loop in document.yourfo rm.elements then check if this element is
    of type say 'text' then check its name if it was MyField (using substr()) if
    so then do validation on its value.

    --
    Elias
    "Spanky" <criticalim@hot mail.com> wrote in message
    news:bc05b85a.0 309071138.695fa 319@posting.goo gle.com...[color=blue]
    > I am looking for some help with the following.
    >
    > I have a form with many fields. I have a table in the form that I
    > need to make all the fields within the table required. Basic
    > validation, just need to make sure they are not blank.
    >
    > Here is the kicker....
    > I have a javascript that adds rows and fields whenever the user clicks
    > a button for add rows. So, the user clicks button and I add a row
    > with about 5 fields. Every time a user clicks I add another row.
    >
    > So, when submitting the form I need to check all fields inside the
    > table tag ID"TEST".
    >
    > Any help or guidance is appreciated.
    >
    > Allen[/color]


    Comment

    Working...