Asp Countdown for 10 seconds then display form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 40esp
    New Member
    • Apr 2007
    • 1

    Asp Countdown for 10 seconds then display form

    Im trying to make my site more secure and to stop spammers..


    in my <div> I have a form with textboxes.

    I want to do this.

    I want it to countdown for 10 seconds, and then when the countdown reaches zero, show the form which was hidden.

    I do not know how to do this and any help would be appreciated =]
  • elmemo
    New Member
    • Apr 2007
    • 30

    #2
    hi,

    what you can do is have the "onload" attribute of your html body element call a javascript function that would getElementById( ) the div of yours where you want your "hidden" form displayed. When it fires, your function would alter the "innerHTML" of the div, and write the html form to it. Here's an example of a javascript function that will alter a div with an id of "pantalla" and have it write "hello world" with the word "world" in bold font:

    Code:
        function showContent () {
           document.getElementById('pantalla').innerHTML = "hello \
                                                         <span style='font-weight:bold;'>  world\
                                                         </span>"
         }
    I don't think you really need the timeout as showing the form contents needs a browser to have javascript anyway, but if you want you can call setTimeOut from the onload attribute in your body element.

    If what you fear is somebody being able to submit to the forms many times in a row this won't work, because a person could figure out what the form will look like after the script, and use curl to submit the form time after time. If this is what you fear, what you really need is TURING PROTECTION. google for that there are ready made controls you can use, or just plain use system.drawing to generate an image and output the resulting image (that presumably only humans can interpret) in the page_load event of an aspx page, then use that page's url as the src attribute of an image.

    Maybe this is not what you are looking for. If you actually want to delay the content delivery of the form, you could use a delay function at page load, or control delivery of the html with the response.write and response.flush methods

    Comment

    Working...