Buck Anderson's DotNetNuke Training and Resource Center - how to profit with DotNetnuke July 05, 2008   
 You Are Here: ..:: DNN Modules » XMod Applications ::.. 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  
DNN Modules  
About Us  
Training  
Resources  
Features  

XMod | Training | Demonstrations | Downloads | Applications

XMod DemosXMod, a DotNetNuke® module created by DNNdev , is an extremely flexible and powerful tool. You can quickly create one-off solutions with little or no knowledge of HTML or programming. However, the more you know, the more you can do. Here's a sampling of what XMod can do.

Powerful XMod applications are available FREE to our subscribers in the DNN professor download library.

See you on the Inside
(Subscription Information)

 Membership has its advantages!


Current Articles | Categories | Search

 
The Poor Man's Read Only Form Control That Accepts Validation
By Buck Anderson @ 12:09 AM :: 486 Views :: :: 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


Rating

All articles available FREE to Subscribers

 Membership has its advantages!

 
Copyright 2008 by Jive Media Group LLC. All Rights Reserved.  | Terms Of Use | Privacy Statement 

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