Buck Anderson's DotNetNuke Training and Resource Center - how to profit with DotNetnuke October 07, 2008   
 You Are Here: ..:: Departments » Search Engine Optimization ::.. Register  Login
JOIN TODAY!  

"Gain immediate access to all our articles, features, downloads, resaleable software applications, how-to's, video tutorials, discussion group, archives plus more."

Click here for details


Product Showcase  
Get Started  
Training  
DNN Modules  
Resources  
Features  

Search Engine Optimization and Search Engine Marketing

Search Engine Optimization and search engine marketing of your web site accomplishes two primary goals. First, it makes your site relevant to your desired search engine queries. Secondly, it makes your site friendly to search engines, by which me mean that search engines are able to easily crawl or index all of the pages and content of your site.

Current Articles | | Search

 
The Poor Man's Read Only Form Control That Accepts Validation
By Buck Anderson @ 12:09 AM :: 1369 Views :: Article Rating :: Website Development, XMod Applications
 

I occasionally find a need to make a form input control read only and required.

In the case below, I needed an input control that would act as a bucket for the Select1 controls value. The category and Sub Category controls are being generated dynamically , from arrays, and I needed the input control to hold the value on saving of the form.

XMod Poor Man's Read Only Control with Validation 

In most cases, I would set this field as style.display='none' and make it invisible. But, in this case, I wanted the user to view the current sub category to ensure it was correct before submitting the form. You can imagine the havoc that would ensue if the user was able to change this value.

If you set the control to read only, and also have a need to validate the control, the validation will fail. It can't read the file.

Setting an Xmod control to read only and required

 

So, I needed an alternative and this solution works pretty well. I call it the Poor Man's Read Only Control.

DNNprofessor.com - Read only control that accepts validation

The first attempt worked well but, if I quickly slid my mouse, while trying to highlight the text, I could find a way to change a few of the characters.

To improve upon the method, I created a change to my CSS class called NormalTextBoxGray.

.NormalTextBoxGray {
    color: #666666;
    font-family: Verdana, Tahoma, Arial, Helvetica;
    font-weight: normal;
    font-size: 10px;
    line-height: 11pt;
    background-color: Whitesmoke;
    cursor: not-allowed;    
}

By changing the cursor to cursor: not-allowed; - I now have a workable solution and a read only control that accepts validation.

Happy coding and enjoy the experience,
Buck


Buck Anderson's DotNetNuke Training, Video Training, and Internet Marketing Resource Center DNNprofessor.com. Free tips to improve your business with DotNetNuke, XMod, website design techniques, and proven unconventional Internet Marketing Solutions that attract the attention of today's savvy Internet buyer at DNNprofessor.com.

© 2008 Jive Media Group LLC and Buck Anderson.
 All Rights Reserved. Reproduction without permission prohibited.


Comments

Click Next to View More Headlines

All articles available to Subscribers

 Membership has its advantages!

Related Articles - Internet Marketing  
 
Copyright 2008 by Jive Media Group LLC. All Rights Reserved.  | Terms Of Use | Privacy Statement 

Page generated in 0.1248008 seconds. | powered byVisit Jive Media Group LLC