Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asptoday_discuss thread: how to make a text box read only


Message #1 by "purushottam" <purushottamk@i...> on Thu, 13 Dec 2001 14:58:54
how to make a text box readonly i mean to say the user cannot be able to 

type anything there because i am displaying date in that field only he can 

view the date
Message #2 by "Bill Reynolds" <breynolds@g...> on Thu, 13 Dec 2001 09:55:06 -0500
Hi!



You can use the following code:



<input type=3D"text" name=3D"asdf" id=3D"asdf" value=3D"asdf" size=3D"5"

maxlength=3D"5" readonly>



BUT!! It only works in HTML 4+.  Archaic browsers may be able to edit

it.



Thanks,

Bill Reynolds

Web Applications Programmer

Graphic Enterprises, Inc.

3874 Highland Park NW

North Canton, OH 44720.8080

xxx-xxx-xxxx  (p)

xxx-xxx-xxxx  (f)





-----Original Message-----

From: purushottam [mailto:purushottamk@i...]

Sent: Thursday, December 13, 2001 9:59 AM

To: ASPToday Discuss

Subject: [asptoday_discuss] how to make a text box read only



how to make a text box readonly i mean to say the user cannot be able to



type anything there because i am displaying date in that field only he

can

view the date

Message #3 by "Nadar, Arvind" <ANadar@a...> on Thu, 13 Dec 2001 09:58:20 -0500
Make it

<input .......... onfocus ="blur">





> ----------

> From: 	purushottam[SMTP:purushottamk@i...]

> Reply To: 	ASPToday Discuss

> Sent: 	Thursday, December 13, 2001 8:28 PM

> To: 	ASPToday Discuss

> Subject: 	[asptoday_discuss] how to make a text box read only

> 

> how to make a text box readonly i mean to say the user cannot be able to 

> type anything there because i am displaying date in that field only he can

> 

> view the date

> 

Message #4 by "Bill Reynolds" <breynolds@g...> on Thu, 13 Dec 2001 10:32:12 -0500
I just tried that one using the following code in IE 5.5:



<input type=3D"text" name=3D"Page" id=3D"Page" value=3D"5" size=3D"1"

maxlength=3D"3" onfocus=3D"blur">



And it did not work for me.



Thanks,

Bill Reynolds

Web Applications Programmer

Graphic Enterprises, Inc.

3874 Highland Park NW

North Canton, OH 44720.8080

xxx-xxx-xxxx  (p)

xxx-xxx-xxxx  (f)





-----Original Message-----

From: Nadar, Arvind [mailto:ANadar@a...]

Sent: Thursday, December 13, 2001 9:58 AM

To: ASPToday Discuss

Subject: [asptoday_discuss] RE: how to make a text box read only



Make it

<input .......... onfocus =3D"blur">





Message #5 by "Nadar, Arvind" <ANadar@a...> on Thu, 13 Dec 2001 12:00:24 -0500
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C183F7.A87A1B60

Content-Type: text/plain



> <input type="text" name="Page" id="Page" value="5" size="1" 

> maxlength="3" onfocus="javascript:blur()">

> 

> ----------

> From: 	Bill Reynolds[SMTP:breynolds@g...]

> Reply To: 	ASPToday Discuss

> Sent: 	Thursday, December 13, 2001 9:02 PM

> To: 	ASPToday Discuss

> Subject: 	[asptoday_discuss] RE: how to make a text box read only

> 

> I just tried that one using the following code in IE 5.5:

> 

> <input type="text" name="Page" id="Page" value="5" size="1" 

> maxlength="3" onfocus="blur">

> 

> And it did not work for me.

> 

> Thanks,

> Bill Reynolds

> Web Applications Programmer

> Graphic Enterprises, Inc.

> 3874 Highland Park NW

> North Canton, OH 44720.8080

> xxx-xxx-xxxx  (p)

> xxx-xxx-xxxx  (f)

> 

> 

> -----Original Message-----

> From: Nadar, Arvind [mailto:ANadar@a...] 

> Sent: Thursday, December 13, 2001 9:58 AM

> To: ASPToday Discuss

> Subject: [asptoday_discuss] RE: how to make a text box read only

> 

> Make it

> <input .......... onfocus ="javablur">

> 

> 

> 




Message #6 by "Rich McQuaid" <remcq@m...> on Thu, 13 Dec 2001 12:44:04 -0500
This is a multi-part message in MIME format.



------=_NextPart_000_0028_01C183D3.D95BBA50

Content-Type: text/plain;

	charset="us-ascii"

Content-Transfer-Encoding: 7bit



How about using "disabled" in the input tag like this?

<input type="text" name="Page" id="Page" value="5" size="1" disabled>

 

 

-----Original Message-----

From: Nadar, Arvind [mailto:ANadar@a...] 

Sent: Thursday, December 13, 2001 12:00 PM

To: ASPToday Discuss

Subject: [asptoday_discuss] RE: how to make a text box read only







	<input type="text" name="Page" id="Page" value="5" size="1" 



maxlength="3" onfocus="javascript:blur()"> 



	---------- 

From:   Bill Reynolds[SMTP:breynolds@g...] 

Reply To:       ASPToday Discuss 

Sent:   Thursday, December 13, 2001 9:02 PM 

To:     ASPToday Discuss 

Subject:        [asptoday_discuss] RE: how to make a text box read only 



	I just tried that one using the following code in IE 5.5: 



	<input type="text" name="Page" id="Page" value="5" size="1" 

maxlength="3" onfocus="blur"> 



	And it did not work for me. 



	Thanks, 

Bill Reynolds 

Web Applications Programmer 

Graphic Enterprises, Inc. 

3874 Highland Park NW 

North Canton, OH 44720.8080 

xxx-xxx-xxxx  (p) 

xxx-xxx-xxxx  (f) 





	-----Original Message----- 

From: Nadar, Arvind [mailto:ANadar@a...] 

Sent: Thursday, December 13, 2001 9:58 AM 

To: ASPToday Discuss 

Subject: [asptoday_discuss] RE: how to make a text box read only 



	Make it 

<input .......... onfocus ="javablur"> 












Message #7 by "Nadar, Arvind" <ANadar@a...> on Thu, 13 Dec 2001 12:48:35 -0500
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C183FE.636379C0

Content-Type: text/plain



It is not supported by Netscape.



> ----------

> From: 	Rich McQuaid[SMTP:remcq@m...]

> Reply To: 	ASPToday Discuss

> Sent: 	Thursday, December 13, 2001 11:14 PM

> To: 	ASPToday Discuss

> Subject: 	[asptoday_discuss] RE: how to make a text box read only

> 

> How about using "disabled" in the input tag like this?

> <input type="text" name="Page" id="Page" value="5" size="1" disabled>

>  

>  

> -----Original Message-----

> From: Nadar, Arvind [mailto:ANadar@a...] 

> Sent: Thursday, December 13, 2001 12:00 PM

> To: ASPToday Discuss

> Subject: [asptoday_discuss] RE: how to make a text box read only

> 

> 

> 

> 		<input type="text" name="Page" id="Page" value="5" size="1" 

> 

> 	maxlength="3" onfocus="javascript:blur()"> 

> 

> 		---------- 

> 	From:   Bill Reynolds[SMTP:breynolds@g...] 

> 	Reply To:       ASPToday Discuss 

> 	Sent:   Thursday, December 13, 2001 9:02 PM 

> 	To:     ASPToday Discuss 

> 	Subject:        [asptoday_discuss] RE: how to make a text box read

> only 

> 

> 		I just tried that one using the following code in IE 5.5: 

> 

> 		<input type="text" name="Page" id="Page" value="5" size="1" 

> 	maxlength="3" onfocus="blur"> 

> 

> 		And it did not work for me. 

> 

> 		Thanks, 

> 	Bill Reynolds 

> 	Web Applications Programmer 

> 	Graphic Enterprises, Inc. 

> 	3874 Highland Park NW 

> 	North Canton, OH 44720.8080 

> 	xxx-xxx-xxxx  (p) 

> 	xxx-xxx-xxxx  (f) 

> 

> 

> 		-----Original Message----- 

> 	From: Nadar, Arvind [ mailto:ANadar@a...] 

> 	Sent: Thursday, December 13, 2001 9:58 AM 

> 	To: ASPToday Discuss 

> 	Subject: [asptoday_discuss] RE: how to make a text box read only 

> 

> 		Make it 

> 	<input .......... onfocus ="javablur"> 

> 

> 

> 

> 




Message #8 by "Patrick" <patrick00@n...> on Thu, 13 Dec 2001 18:28:34 -0000
If you are displaying the results from a dbase example <input type=text

name=box value="<%=rs("info")%">

then providing you are not asking them to submit info at the end of that

form it will make no difference if they try to change the cata in the text

box as it will have no effect.



If however the data displayed is included in a form where you are asking

them to fill data in and there is a submit button then do not display the

data in a text box. Just write the data to the screen in a table. Example

<tr>

<td>Your IP is <%request.servervariables("REMOTE_HOST") %> "This is screen

display"

</td>

<td><Input type=text name=name>This is a box they can fill info in

</td>

</tr>



Failing that then declare a variable for each box that you do not wish them

to edit at the begining of the page. than when they submit the form send it

to a check page then when the fields are requested you tell it there that

request("name") = VarName.



Example

VarName = Patrick



So even if they do enter a different value in the box it will default back

to the VarName value







----- Original Message -----

From: "purushottam" <purushottamk@i...>

To: "ASPToday Discuss" <asptoday_discuss@p...>

Sent: Thursday, December 13, 2001 2:58 PM

Subject: [asptoday_discuss] how to make a text box read only





> how to make a text box readonly i mean to say the user cannot be able to

> type anything there because i am displaying date in that field only he can

> view the date

>



Message #9 by "asame" <asame00@y...> on Thu, 13 Dec 2001 23:36:48 -0000
Avoid browser specific code and as a rule of thumb. You can allow your

user's to have a field day with your text boxes then "do one on 'em" as soon

as they click "submit" - all by submitting the proper values using hidden

fields.



----- Original Message -----

From: "purushottam" <purushottamk@i...>

To: "ASPToday Discuss" <asptoday_discuss@p...>

Sent: Thursday, December 13, 2001 2:58 PM

Subject: [asptoday_discuss] how to make a text box read only





> how to make a text box readonly i mean to say the user cannot be able to

> type anything there because i am displaying date in that field only he can

> view the date









_________________________________________________________



Do You Yahoo!?



Get your free @yahoo.com address at http://mail.yahoo.com








  Return to Index