Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Different Format 4 Different Forms
billyp1970
Junior Member

Posts: 5
Registered: 3/27/2005
Member Is Offline
posted on 3/28/2005 at 12:49 AM Reply With Quote
Different Format 4 Different Forms


Ok, this is probably very rudimental for some of you, but I'm not a Java Coder so here goes.

I have two forms on a page (sometimes if they're not logged in) the log in form has a smaller font. Now I want the forms font to stay the same size when validated. Ok I see this is clear as mud. On one form font size=9px, on another font size=12px. When form 1 is validated, I want the font size to stay 9px but get bold, if form 2 is validated, I want the font size to stay 12px and get bold. I know CSS is involved, but how do I set up the logic in the validation.js? I know I can call the form name and set up the logic that way, but I don't know how to call for the "form name".
View User's Profile View All Posts By User U2U Member
billyp1970
Junior Member

Posts: 5
Registered: 3/27/2005
Member Is Offline
posted on 3/29/2005 at 05:01 AM Reply With Quote
Posting My Solution For Everyone


Ok, I figured it out, I'm posting the change here for the benifit of anyone else who may sometime need to figure it out.

Step 1). Open the validator.js and find this line: "if (b_dom && this.a_fields[n_key].o_tag)
this.a_fields[n_key].o_tag.className = 'tfvHighlight';
}"

Under this section " // collect error messages and highlight captions for errorneous fields"

..................................

Step 2) Then replace (or add to it) these lines:

"if (b_dom && this.a_fields[n_key].o_tag){
var form = this.s_form;
if (form == "login")
this.a_fields[n_key].o_tag.className = 'fixlogin';
else
this.a_fields[n_key].o_tag.className = 'fix';}
}"

where 'fixlogin' and 'fix' are the CSS Classes you want the label to change too, and "login" is the specific form you want the action to occur on. Be careful using what I posted, please notice I included the original line of "if (b_dom && this.a_fields[n_key].o_tag)" in my code so as to give you a ref.

..................................

Step 3) Find the parameter for the "normal" font and text by finding the line: "e_labeltag.className = 'tfvNormal';
}"

Under: "// normal state parameters assigned here"

..................................

Step 4) Add and change these lines:
var form = this.s_form;
if (form == "login")
this.a_fields[n_key].o_tag.className = 'formlogin';
else
this.a_fields[n_key].o_tag.className = '';}
}"

Where 'formlogin' and '' are the classes for the NORMAL prarms, and form is the name of the specific form.
Notice that my "normal" class has no CSS specified, if your's does have a specific class name do include it, mine does not.

This can be modified even more by adding or (||), and (&&) or other if statements. I hope this helps someone.

Happy coding
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page Product Page
Product Demonstrations Product Demos
Registration Form Validation
Login Form Validation
Free Download Free Download
Product Documentation Documentation
Documenation Page
Change Log
Validators Comparison Table
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004