Forums

Layout incorrect when valdation field pops up.

syco 09 Mar, 2009
Hi guys,

2x Questions !

1) Just wondering is there something I can do to change the way the validation warnings work.
I would like to make the wording 'RED' for the "This is a required field." warning.

2) Also, is there something I can do to stop the "submit button" from pushing down, as it goes over the bottom ("other") menu.

[attachment=0]Form-edits.gif[/attachment]

Thx,

Syco
GreyHead 09 Mar, 2009
Hi syco,

1) add css for the .validation-advice {. . .} selector

2) The best solution that I have found is to add a height style to the form that leaves enough space for a few error messages.

Bob
syco 09 Mar, 2009
Hi Bob,

2) ... add a height style to the form that leaves enough space for a few error messages.


I added this height style as you said to do and it has fixed the issue for me... thx <div style="height: 750px;"> Thanks πŸ™‚

In regards to the colour change of the validation advice to red.. you said to

... add css for the .validation-advice {. . .} selector


As I have no formal training in CSS, html, or PHP... where do input the css. In the "Form HTML"?
I couldn't find the file or the place or if there's a parameter that has - .validation-advice {. . .} selector.
Sorry if this sounds dumb.. :?

Regards,

Syco
GreyHead 09 Mar, 2009
Hi syco,

Put this code snippet at the beginning of your form html
<?php
$doc =& JRequest::getDocument();
$style = ".validation-advice {
  color:red;
  font-weight:bold;
}";
$doc->addStyleDeclaration($script);
?>

Bob
syco 09 Mar, 2009
Hi Bob,

I placed your snippet in the top of the FORM html... but got this error.

Fatal error: Call to undefined method JRequest::getdocument() in /clientdata/clients/t/e/test-swishimage.au.com/www/care157/components/com_chronocontact/chronocontact.html.php(351) : eval()'d code on line 2

I have since deleted the snippet out, until I hear from you again, but once again thanks for being so helpful and so quickπŸ™‚

Regards,
Syco
GreyHead 10 Mar, 2009
Hi syco,

Which version of Joomla are you using? I think it must be 1.0.x?? This should work OK there, again in the beginning of the Form HTML
<style type='text/css'>
.validation-advice {
  color:red;
  font-weight:bold;
}
</style>

Bob
syco 10 Mar, 2009
Hi Bob,

I'm using 1.5.8 and what you sent worked perfect. πŸ˜€ πŸ˜€ πŸ˜€

Thank you so much for your help. I really appreciate quality support like this.

Cheers

Syco
northie 26 Mar, 2009
Here's a tip if you have more than 1 ChronoForm on your site. Instead of adding the .validation-advice CSS to each FORM HTML, just add it once to style1.css (and style1-ie7.css) and then all your ChronoForms on that site will display the error in bold red.
Max_admin 26 Mar, 2009
Thanks for the tip!!πŸ™‚

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jvreeken 05 Apr, 2009
/* Chrono Contact */
.validation-advice {color:red; font-weight:bold;}
This topic is locked and no more replies can be posted.