The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
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">
function validatePage(form, rules)
{
    if (rsv.validate(form, rules))
    {
        document.getElementById("myform").submit();
    }
}
</script>

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">
<!--
function getguide ( selectedtype )
{
  document.supportform.supporttype.value = selectedtype ;
  document.supportform.submit() ;
}
-->
</script>

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">
<!--
function getguide ( selectedtype )
{
  var f = document.getElementById("supporttype");

  // if everything validates OK, submit the form!
  if (rsv.validate(f, rules))
  {
    document.supportform.supporttype.value = selectedtype ;
    document.supportform.submit() ;
  }
}
-->
</script>

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