Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old January 17th, 2007, 06:03 AM
Newbie
 
Join Date: Jan 2007
Posts: 9
Default Disable/enable Textbox Buttons

Hi guys
can someone kindly help me about my code it seems incomplete or i just can make it right .I try using the disabled property of the textbox yes it workss, it disable it but when i set it to false like disabled="false" it does not enable the textbox.This is my code



<p><input type="text" name="txtbox1" size="20" disabled="true">
<input type="button" value="Click" name="B3" disabled="true"> Operator</p>
<p><input type="text" name="txtbox2" size="20"disabled="false">
<input type="button" value="Click" name="B4" disabled="false"> Supervisor</p>


thanks and regards
metalwing
Reply
  #2  
Old January 17th, 2007, 02:24 PM
shweta123's Avatar
Expert
 
Join Date: Nov 2006
Location: India,Pune
Posts: 664
Default

Hi,

Don't give any value for Disabled property.e.g. <Input type="Text" Disabled>
If you want to make the Textbox Enabled just dont give anything there.
Reply
  #3  
Old January 17th, 2007, 11:30 PM
Newbie
 
Join Date: Jan 2007
Posts: 9
Default

Quote:
Originally Posted by shweta123
Hi,

Don't give any value for Disabled property.e.g. <Input type="Text" Disabled>
If you want to make the Textbox Enabled just dont give anything there.

hi shweta123

yahh i already did that what i want to do is that when i click the button in my asp it will disable the previous active button and textboxes..But it seems that whatever propertyi work with wether it is disabled or enable regardless of value(true or false) it seems not accepting the value..tnkss hope you can help me..

metalwing
Reply
  #4  
Old January 18th, 2007, 12:28 PM
shweta123's Avatar
Expert
 
Join Date: Nov 2006
Location: India,Pune
Posts: 664
Default

Hi,

I am not getting where exactly its going wrong .You can try these lines
be4 making textbox or any control enabled or disabled.

for(i=0;i<form.elements.length;i++)
{
if(form.elements[i].disabled="false")
form.elements[i].disabled="true";
}

Shweta
Reply
  #5  
Old January 19th, 2007, 12:39 AM
Newbie
 
Join Date: Jan 2007
Posts: 9
Default

Quote:
Originally Posted by shweta123
Hi,

I am not getting where exactly its going wrong .You can try these lines
be4 making textbox or any control enabled or disabled.

for(i=0;i<form.elements.length;i++)
{
if(form.elements[i].disabled="false")
form.elements[i].disabled="true";
}

Shweta
hi

well what im trying to do is that i have 4 textboxes and buttons
the first textboxes and buttons is enable and the rest disabled.when i click the first button it will enable the second textbox and button while disabling the first textbox and button.
hope you can help me..

thanks and regards
metalwing
Reply
  #6  
Old September 24th, 2008, 01:39 AM
Member
 
Join Date: Sep 2006
Posts: 70
Default

how about vbscript to enabled and disabled textbox outside of textbox control
like<% if session("Pwd")="" then textbox1.disabled=true end if%>
and also assign value to textbox outside of textbox control?
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 204,687 network members.
Post your question now . . .
It's fast and it's free

Popular Articles