Solved

Disable a text box

Posted on 2002-07-08
10
203 Views
Last Modified: 2013-12-24
Hello experts,

I'm working on a page where I have a text box that I want to display something only.  I have a link that allows the user to select an employee (LDAP query) in a popup window.  Once selected the current application populates the text box on the parent form with the name they selected.  So I've been able to automate the process but I want to be sure the user doesn't then overtype a name that might not exist in the LDAP.  My thinking is that the simplest approach would be to somehow disable the text box for data entry.

I know you can disable the text box in IE but I have to make this work in Netscape (4.7) as well.  The display for the text box is populated by some Javascript.  The user must choose something.  Any suggestions.  Thanks

TD
0
Comment
Question by:tdenny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 3

Expert Comment

by:winningl
ID: 7138418
It sounds like you just need a label but not a text box. In that case, the simplest solution is not use the text box. You can just display the text itself with some special background.

winningl
0
 

Author Comment

by:tdenny
ID: 7138474
Winning,

A good point but the javascript that I am currently using to populate the textbox on the parent form will only work to populate a text box.  
0
 

Author Comment

by:tdenny
ID: 7138603
Winning,

A good point but the javascript that I am currently using to populate the textbox on the parent form will only work to populate a text box.  
0
The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

 

Author Comment

by:tdenny
ID: 7138627
Winning,

I wasn't aware of a "label" control in HTML. I know in access you can create a text box or a label and that the label can be populated with any number of possibilities but I didn't know you could do something like this in HTML
0
 
LVL 3

Expert Comment

by:SewellM
ID: 7138640
There is an article with some possible solutions to your problem at
http://tech.irt.org/articles/js131/index.htm

It explores several possibilities for disabling form elements.

Michael
0
 
LVL 3

Expert Comment

by:SewellM
ID: 7138656
Ooops, forgot one,
There is also an example at
http://www.devguru.com/features/knowledge_base/A100212_form.asp

This is supposed to work in NN4.x, but I have not tested it.

Michael
0
 

Author Comment

by:tdenny
ID: 7138766
SewellM,

I'm testing to see if I can get one of your suggested links to work in Netscape without losing any of my other functionality.  Thanks for the response.  
0
 
LVL 3

Expert Comment

by:dapperry
ID: 7149725
A really simple way is to not allow them to focus on the text box using a bit of javascript. Heres a short example:

<script language="javascript">
     function GetLDAPUser() {
        /* Put your window opening codehere */
     }
</script>
<form name="form1" action="whatever.cfm" method="post">
     <input type="text" name="LDAP_User" onfocus="document.form1.btnSelectUser.focus();" style="....">
     <input type="button" name="btnSelectUser" onclick="GetLDAPUser()">
     ....
</form>

Hope this helps,

:) dapperry
0
 
LVL 1

Accepted Solution

by:
lpkuah earned 100 total points
ID: 7176491
or another alternative

<input type="text" name="name1" value="" onFocus="this.blur()">
0
 

Author Comment

by:tdenny
ID: 7177436
lpkuah, daperry,

I really liked both of your answers.  Both tested and both will work.  Not sure how to split up the points or if I can even do that.  Thanks very much for those very clever solutions!!!
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question