SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamic Text Box Verification

    Hello
    I am having dynamic text boxes with name
    Text<%Codevaluefromtable%>

    so the no of records in the table= no of text boxes in the form.
    Each text box will have a hyper link adjacent to it and when anybody click that i want to check if the corresponding text box is empty or not and if is not empty then i should do the next operation or else have to alert the user to enter value in that text box.

    Text1 hperllink onclick" gotovalidatefunction(1)"
    Text2 hperllink onclick" gotovalidatefunction(2)"

    Text10 hperllink onclick" gotovalidatefunction(10)"



    this is the structure and if assume if user click a hpperlink next to Text2
    then i pass the value 2 to a javascript function and have to validate that text box has any value entered

    function gotovalidatefunction(ValidateCode)
    {
    if (document.formname.text+ValidateCode+.value=="")
    { alert ("Enter a value")}

    else
    { do the next part}

    }


    when i tried to use it like this it gives an error called syntax error.
    how can i implement this using javascript
    with regards
    vimal
    Knowledge is all about Sharing

  2. #2
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found out the error
    actually i have to use it like this
    function gotovalidatefunction(ValidateCode)
    {
    if (document.formname[text+ValidateCode].value=="")
    { alert ("Enter a value")}

    else
    { do the next part}

    }
    Knowledge is all about Sharing


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •