Form field reset need help

 

Results 1 to 4 of 4
does any1 know how to reset a form field? lets just say email add is ...
  1. #1
    thorjack1990's Avatar
    thorjack1990 is offline Banned - see signature
    Join Date
    Feb 2013
    Posts
    71
    Thanks
    19
    Thanked 9 Times in 5 Posts
    Blog Entries
    1

    Default Form field reset need help

    does any1 know how to reset a form field? lets just say email add is missing when you submit the form then a pop-up appear saying "email required" when clicking ok the form and captcha will automatically reset.,any help plz?
    This member has been permanently banned from BHW.




  2. #2
    Lyscer's Avatar
    Lyscer is offline Junior Member
    Join Date
    Jun 2012
    Posts
    109
    Thanks
    10
    Thanked 42 Times in 24 Posts

    Default Re: Form field reset need help

    If you were to do this on the client side with javascript it would be pretty simple - however, client side scripts can be circumvented and manipulated, so server side is the best but that requires that the form is submitted and processed. If you want a quick and dirty client side script, I found this on google: stackoverflow.com/questions/3279628/checking-the-form-field-values-before-submitting-that-page that does a good job showing you how to validate a form. With this method you wouldn't need to clear the captcha form for them to resubmit.

  3. #3
    thorjack1990's Avatar
    thorjack1990 is offline Banned - see signature
    Join Date
    Feb 2013
    Posts
    71
    Thanks
    19
    Thanked 9 Times in 5 Posts
    Blog Entries
    1

    Default Re: Form field reset need help

    Quote Originally Posted by Lyscer View Post
    If you were to do this on the client side with javascript it would be pretty simple - however, client side scripts can be circumvented and manipulated, so server side is the best but that requires that the form is submitted and processed. If you want a quick and dirty client side script, I found this on google: stackoverflow.com/questions/3279628/checking-the-form-field-values-before-submitting-that-page that does a good job showing you how to validate a form. With this method you wouldn't need to clear the captcha form for them to resubmit.
    how do u make a form reset? after submitting the form then i go back.,the form still has data on it.,i need to know the code to reset it when going back to prevent spammer.
    This member has been permanently banned from BHW.

  4. #4
    Lyscer's Avatar
    Lyscer is offline Junior Member
    Join Date
    Jun 2012
    Posts
    109
    Thanks
    10
    Thanked 42 Times in 24 Posts

    Default Re: Form field reset need help

    What do you mean by "then I go back" like you submit it and then hit the back button? If that is the case then you could look at the referrer url (the page that sent you to your form). and if the referrer is your submit page then clear all the values out. If you google "javascript check referring url" you can see what I am referencing. Once again though, if they have javascript turned off then this will be pointless. If you are using PHP then you can check the referring url in the $_SERVER variable and if the isset($_SERVER['HTTP_REFERER']) and it is equal to your submit page then I would just do a header redirect to the same page to reload it which would effectively clear out all of the values in a couple lines of code. Good luck.


Similar Threads

  1. Replies: 2
    Last Post: 12-10-2010, 02:14 PM
  2. Replies: 2
    Last Post: 12-02-2010, 02:08 AM
  3. Replies: 1
    Last Post: 08-07-2010, 07:06 AM
  4. Pass A Subid Into A Hidden Form Field
    By black_ice007 in forum General Scripting Chat
    Replies: 1
    Last Post: 02-08-2010, 11:51 PM
  5. How do I code an iframe that only shows the form field?
    By miketh2005 in forum Making Money
    Replies: 5
    Last Post: 11-02-2009, 09:45 PM

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
  •  




BlackHatWorld on Twitter BlackHatWorld on FaceBook


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108