Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    using javascript to disable submit button

    My client wants to create coupons for his site, but wants it so that if a visitor number reaches 10 they cannot submit the form and are given an error message to say that the coupon limit is reached.

    Can this be done with javascript to say gather a count of visitors and then automatically disable the submit button with a popup message?

    Thanks in advance for your help.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,013
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Quote Originally Posted by jonathan76 View Post
    My client wants to create coupons for his site, but wants it so that if a visitor number reaches 10 they cannot submit the form and are given an error message to say that the coupon limit is reached.

    Can this be done with javascript to say gather a count of visitors and then automatically disable the submit button with a popup message?

    Thanks in advance for your help.
    No. Javascript is a client-side language. You will need server-side coding for this.

    Quizmaster: What is an ice hockey puck made of?
    Contestant: Granite.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Tags for this Thread

    Posting Permissions

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