The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
|
Really Simple Validation (RSV) - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Really Simple Validation (RSV) (/showthread.php?tid=25) |
Really Simple Validation (RSV) - antonitus - Mar 3rd, 2009 Hi Ben, Are you involved with the development of the Really Simple Validation (RSV) script? I could not find a forum on that site. If so, I have a small issue with it and you maybe able to help. It's to do with the validation using the standard 'Submit' button which works like a treat, however my button is not a standard button but straight text which acts like a button and it's controlled by some javascript code to make it act like a real button. The RSV script doesn't like it and I'm at a dead end as to how to resolve this without having to add the standard 'Submit' button. If you are not involved with this, please accept my apology. Regards, Tony RE: Really Simple Validation (RSV) - Ben - Mar 3rd, 2009 Hey Tony, Yes, it's my script. I never got round to adding a forum on my site, and eventually we're going to move it to our company site so it'll finally get a forum there! w.r.t. your problem, try this: 1. Instead of adding the onsubmit="return rsv.validate(this, rules)" attribute to the form tag (which only gets called when a submit button is pressed), add this attribute to your button: <input type="button" value="Submit" onclick="validatePage(this.form, rules)" /> Then, add the following JS to your page <head> - maybe in the same spot as where you define the rules: Code: <script type="text/javascript"> Note: "myform" needs to be the ID of your form. So your form tag would need an id="myform" attribute. And that's it! Let me know how it goes! RE: Really Simple Validation (RSV) - antonitus - Mar 3rd, 2009 Hi Ben, Thanks for your response. I don't think this'll work on my script. As my button is just a text button and not the normal HTML submit button. It also comes with a javascript snippet as follows: Code: <script language="JavaScript" type="text/javascript"> And this is the text submit button code: Code: <a href="javascript:getguide('Submit')" class="submitemailguide"> Could there still be a solution to this using your validation script? If not, it doesn't really matter. Regards, Tony RE: Really Simple Validation (RSV) - Ben - Mar 3rd, 2009 Ah, I see. In that case, try tweaking the JS function to this: Code: <script language="JavaScript" type="text/javascript"> Unless I missed something, that should be all you need to do. Let me know! RE: Really Simple Validation (RSV) - antonitus - Mar 3rd, 2009 Hi Ben, This doesn't seem to work I'm afraid. When I click on the button nothing happens. Do I still need to add the onclick code that you mentioned above or is this only for the actual standard input tag button? Regards, Tony RE: Really Simple Validation (RSV) - Ben - Mar 3rd, 2009 Hmmm... I don't suppose I could see the form? Is it available on the web somewhere? If it's private, feel free to email it to me at formtools@encorewebstudios.com That snippet of code should have been all you need, so I'm clearly doing something daft! RE: Really Simple Validation (RSV) - antonitus - Mar 3rd, 2009 Hi Ben, I sent you an email. I just realized, I'm not sure why I sent you the email as I'm not trying to hide the site from anyone. I'm doing it for a lawyer friend of mine and I'm sure the exposure will do her good. Thanks, Tony RE: Really Simple Validation (RSV) - Ben - Mar 3rd, 2009 Haha :-) I just emailed you back. Let me know if that doesn't fix it (I just had the ID wrong). - Ben |