Data Access Worldwide Knowledge Base

Article ID 2298
Article Title HOWTO: Disabling a HTML input control connected to a VDF web application
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2298
KBase Category VDF12
Date Created 03/14/2007
Last Edit Date 03/22/2007


Article Text
QUESTION:
When I mark my table.column in Database Builder as NOENTER and I let VDF generate the HTML input statement the HTML control will not accept input, This is OK but I would like a more visual clue why it does not accept input. I would like to - like Windows - shadow the control. How do I do that.

ANSWER:
If you use an ASP statement like:

<%=oCustomer.DDValue("Customer.Balance",DDFORM)%>

the generated code will be like:

<input type="text" size="8" readonly="readonly" name="customer__balance" value="0" />

to really shadow it the control should have it's disabled attribute set as well. So you need a result as:

<input type="text" size="8" readonly="readonly" disabled="disabled" name="customer__balance" value="0" />

You can achieve this by augmenting the DDReadOnlyHTML function of the cWebBusinessProcess class (or object). Add the following code to your WBO and the result will be as above.

Function DDReadOnlyHTML integer hMain integer iFile integer iField returns String
    String sData
    
    Forward Get DDReadOnlyHTML hMain iFile iField To sData
    If (sData <> "") Begin
        Move (sData * 'disabled="disabled"') To sData
    End
    
    Function_Return sData
End_Function

NOTE: This feature does only work when you select dynamic input controls when constructing the ASP file with the Web Entry Wizard. When you select static code the INPUT statement is generated once and you can add the disabled attribute manually to the HTML code.


Contributed By:
Vincent Oorsprong
Company: Data Access Worldwide
email: vincent.oorsprong@dataaccess.eu
Web Site: http://www.dataaccess.eu


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.