|
you need to get the client side Id of the textbox, which you get with it's ClientID property. You need to write this to a variable in javascript, then write script which uses document.getElementById to access the textbox, then set it's disabled property
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
mstxtRange is text box id
rb4 is radiobutton
I have added the following this on my page load
rb4.Attributes.Add("onClick", "EnableTxtBox();")
rb4.Attributes.Add("onBlur", "EnableTxtBox();")
Function EnableTxtBox()
{
if (document.form1.rb4.checked == true)
document.form1.getElementsById("mstxtRange").enabled = true
else
document.form1.getElementsById("mstxtRange").enabled = false
}
I have written the above js. It is not working well. What is the probm. with this
Balasubramanian K.
|
|
|
|
|
BalasubramanianK wrote: mstxtRange is text box id
Doubtful. Are you sure that's the id on the client side ?
Do you have firefox ? If you install firebug, you can debug your script by running it in FF.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Have you ever worked on javascript?
First of all javascript is case sensitive language so you can not define function as Function.
Are you using Radio Button list control if no then use RadioButtonList control and change your javascript as belove script
HTML Source code
[ this is an example. you can change it as per your requirement. here when I click on first radio button then textbox will be enable while on other radion button it will be disable ]
<asp:RadioButtonList ID="rblDate" runat="server" RepeatDirection="Horizontal" onclick="hideDateRange(this);">
<asp:ListItem Value="0">By date</asp:ListItem>
<asp:ListItem Value="1" Selected="True">Today</asp:ListItem>
<asp:ListItem Value="2">This week</asp:ListItem>
<asp:ListItem Value="3">This month</asp:ListItem>
<asp:ListItem Value="4">All</asp:ListItem>
</asp:RadioButtonList>
Javascript Code
function hideDateRange(obj)
{
if(document.getElementById('rblDate_0').checked)
document.getElementById('txtID').disabled=false;
else
document.getElementById('txtID').disabled=true;
}
Note : My radioButtonList control ID is rblDate and I want to enable textbox on firsl radio button check event so i have checked 'rblDate_0' id checked or not. You can set as per your requirement. and txtID is my textbox id.
regards
khan
please don't forget to vote on the post that helped you.
|
|
|
|
|
hello
sir i have 2 table.
in one table name is client details and other is contact details.
i want to add data both these table.
but in second table i want to add two time recod.
i take one feild in table flag_O_R .
when i add first record ie add O means official contact details
and other is R means residential details.
pls tell me code.
Gayatri
|
|
|
|
|
what is imp ?
Do you really believe that you've given us enough info to write this code for you ? Or that it's appropriate to us ask to do your job without giving any evidence that you've at least tried ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
niki_nilu wrote: Subject: imp
niki_nilu wrote: i want to add data both these table.
What kind of data, and what operation do you mean exactly when you say that you want to add the data?
niki_nilu wrote: but in second table i want to add two time recod.
i take one feild in table flag_O_R .
when i add first record ie add O means official contact details
and other is R means residential details.
Do you want to filter the data in some way, or what do you mean? How does the flag affect the operation that you want to do?
niki_nilu wrote: pls
Please don't use txtspk (SMS style abbreviations) in forum postings. Especially as your english is a bit weak, you don't want to make it more confusing.
niki_nilu wrote: tell me code.
Right now there isn't really enough information to write any code. Perhaps if you make an attempt at writing some of the code, that might help in making it clearer what it is that you are trying to do.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
niki_nilu wrote: but in second table i want to add two time recod.
So for every 1 record in first table you want to add two in the second table?
Ive read your posts several times and Im not sure why you want this to happen?
please explain more
We are not a Code Charity
|
|
|
|
|
Hi,
i have an asp.net project that contains a subfolder (myproj/subfolder) with some classes and pages
i want to run what is in the subfolder in this fashion
http://localhost/subfolder/.... etc
can i do that ?
i tried to create a virtual directory in IIS that points to myproj/subfolder
but when i run the link
http://localhost/subfolder/Client/UserPermissions.aspx
i got the error
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'subfolder.Client.UserPermissions'.
Source Error:
Line 1: <%@ Page language="c#" Codebehind="UserPermissions.aspx.cs" AutoEventWireup="false" Inherits="subfolder.Client.UserPermissions" %>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
Line 3: <HTML>
Source File: C:\Inetpub\wwwroot\myproj\subfolder\Client\UserPermissions.aspx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
|
|
|
|
|
If you left IIS alone, this would just work
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ayman Mashal wrote: can i do that ?
Sure, You Can !!
Ayman Mashal wrote: i got the error
Make Sure, you made the RootDirectory as Virtual Directory means
<br />
http:
if this is your path then Subfolder should be the virtual Directory
And Please Check The Asp.Net Version Of IIS -> Virtual Directory Property <br />
-> Asp.net Version.<br />
<br />
Make sure this is same with your Development version.
|
|
|
|
|
Ive found in the past that setting up my folder in sub directories and then using that in virtual directory causes problems, althought that might just be me
Or the code behind file may:
a. not be called that
b. might be in a different folder which may cause problems
hope this helps
We are not a Code Charity
|
|
|
|
|
The problem is that his page relies on code that's in the app_code folder at the root, which he's just cut off at the knees.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thank u all
i fixed the problem by making the virtual directory type as a direct link
|
|
|
|
|
Hi i need based on current date it have to enable that week dates only...,
That also want to be enable upto current date only...,
It mean example foer this month week dates start and end like this :
1 to 7 , 8 to 14 , 15 to 21 , 22 to 28 and 29 to 5
Now the current date is 24 so it have to enable 22 to 24 dates only...,
Suppose the current date is 20 thne it have to enable only 15 to 20...,
Plz give me some solution for this...,
Here i can't add or minus dates...,
Based on current date have to enable only current week dates ?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
The dateTime class has a DayOfWeek property
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This is a repeat post
We are not a Code Charity
|
|
|
|
|
Ya thank u for ur reply sir,
Using day week u can select a particular week dates...,
But how to disable other dates?,
I need only the current date contained day week enable true...
Plz help me
I searched , but i didnt get
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
OK - when you said enable, I assume you meant to validate. Now I am guessing you're using some sort of date control, but you've not bothered to tell us about it. If you want to only allow certain dates in a date control, you need to explain that, and it depends on if the control you're using, allows that.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi thank u for ur reply...,
My enduser have to enter his activitice in my page...,
He have only rights to enter particular week activitice...,
and same time he cant enter future activity so up to current date i have to be enable the date...,
And previously i said he can enter and modify current week activity only...,
so i need teh calendar control have to be enable current week dates...,
This is my issue...,
Now u plz tell me,
how i can check the week starting date based on current date?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
check this out, apply the logic and you might find this weeks date
http://forums.asp.net/p/1263002/2365683.aspx
We are not a Code Charity
|
|
|
|
|
New one wrote: how i can check the week starting date based on current date?,
Didn't we establish that the Datetime class has a dayofweek property in my first reply ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hello friends
I want to display a please wait message
for this i have tried with the div tag
on the button( asp control) click i am making
waitscreen.Style.Add(HtmlTextWriterStyle.Display, "block");
and after completion of the codes
waitscreen.Style.Add(HtmlTextWriterStyle.Display, "none");
it is not working correctly .. please tell me how a please wait message is displayed normally and if there is any ajax control for it . then please tell me abt it
* my button is under a update pannel
Thanks and Regards
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
U can go for update progress control
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Thanks allot NEWONE
I have voted 5
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|