Does anyone know

Discussion in 'JavaScript' started by oo7ml, Oct 23, 2007.

  1. #1
    Hi, i need to change the form validation on one of my fields. At the moment it checks to see:

    if ((numofchar<1) || (numofchar>500) || value=='(Please fill in this field)')
    HTML:
    - that the field has less than 1 character
    - that the field has more than 500 characters
    - if the field has the text (Please fill in this field)

    I need to change it to check to see if the filed contains (Please fill in this field) along with other characters... So at the moment the validation will pick up if the filed has

    1. (Please fill in this field)
    BUT what is it has
    2. (Please fill in this field)asdsfdf


    Can someone please adjust my code above to make sure that it checks to see if the field contains the string (Please fill in this field) instead of just looking for (Please fill in this field) exactly, thanks for your help
     
    oo7ml, Oct 23, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    ajsa52, Oct 23, 2007 IP
  3. temp2

    temp2 Well-Known Member

    Messages:
    1,231
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    150
    Digital Goods:
    2
    #3
    So difficult to do your request, because we must do a lot of thing to check string, we can use many different algorithms to do it for good, so it's unnecssesary to spend time for this thing; I think that :D
     
    temp2, Oct 23, 2007 IP