Results 1 to 5 of 5

Thread: validation in javascript

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    33

    validation in javascript

    i am new in programming
    i am having 10 asp forms i want to do validation i create separate file commonfunctions.js where i will keep all common functions in my project
    now pl tell me how to write validation code
    which will check all textboxes should not be blank how to refer all
    forms in function
    pl pl. help me

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: validation in javascript

    First, do the validation server-side. When you're satisfied with that, then you can do some validation client-side.

    For that, learn JavaScript. Really learn it, not look at two small scripts and then come to a forum asking people to do it for you.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: validation in javascript

    Validation in JavaScript should only complement validation on the server-side. Otherwise, if the user has JavaScript turned off, you're screwed.

    Unless of course, you're submitting the form via JavaScript and only via JavaScript -- then the user can't do anything.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: validation in javascript

    Sure. He can manually submit garbage to your server and corrupt your database.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: validation in javascript

    There is no reliable way of ensuring where a HTTP request comes from - you must deal with whatever you get.

Posting Permissions

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



Click Here to Expand Forum to Full Width