|
I have two functions.
function funEnableOrDisableTxtBox(objTextbox, objRadiobutton)
{
}
function funIsTextBoxEmpty()
{
}
I hv writn the follwong in page load
----
rbRndQRSSPoor.Attributes.Add("onClick", "funEnableOrDisableTxtBoxmstxtRndPoor1,rbRndQRSSPoor);")
btnSubmit.Attributes.Add("onClick", "return funIsTextBoxEmpty();")
---
Like this, I am calling this same function from other radio buttons click event also. If I comment this attributes.add, my page is loading well. But If I comment the body of the function, I am getting the error. Simply, I tried by giving the function name with out any body like mentioned above. Eventhough, I am getting Done with error. What to do? I think my problem is in attribute?
Balasubramanian K.
|
|
|
|
|
BalasubramanianK wrote: rbRndQRSSPoor.Attributes.Add("onClick", "funEnableOrDisableTxtBoxmstxtRndPoor1,rbRndQRSSPoor);")
Look at above code.
You have missed "("
It should be
funEnableOrDisableTxt(BoxmstxtRndPoor1,rbRndQRSSPoor);
regard
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
No. No. I might missed to type in message board. '(' is there already
Balasubramanian K.
|
|
|
|
|
BalasubramanianK wrote: No. No. I might missed to type in message board. '(' is there already
Ok.So post your javascript function with code
please don't forget to vote on the post that helped you.
|
|
|
|
|
Problem is.........
I 've 4 radio buttons for Excellent, Good, Avg, Poor and one text box. If user select the poor, my txt box should be enabled and got focus. This is the requirement. So, I am calling this function for each radio buttons by passing arg.
rbRndQRSSPoor.Attributes.Add("onClick", "funEnableOrDisableTxtBox(mstxtRndPoor1,rbRndQRSSPoor);")
rbRndQRSSExc.Attributes.Add("onClick", "funEnableOrDisableTxtBox(mstxtRndPoor1,rbRndQRSSPoor);")
rbRndQRSSGood.Attributes.Add("onClick", "funEnableOrDisableTxtBox(mstxtRndPoor1,rbRndQRSSPoor);")
rbRndQRSSAvg.Attributes.Add("onClick", "funEnableOrDisableTxtBox(mstxtRndPoor1,rbRndQRSSPoor);")
function funEnableOrDisableTxtBox(objTextbox, objRadiobutton)
{
if (objRadiobutton.checked == true)
{
objTextbox.disabled = false;
objTextbox.focus()
}
else
{
objTextbox.disabled = true;
objTextbox.value = "";
}
}
on the above, I am passing the same args for all the dif radio buttons. Is not a proper way?.
Balasubramanian K.
|
|
|
|
|
Take RadioButtonList and call javascript onclick event and check Poor item is checked or not and make disabled true or false.
<asp:radiobuttonlist id="rbtn" runat="server" repeatdirection="horizontal" onclick="chk();" >
<asp:listitem text="Poor" value="0"></asp:listitem>
<asp:listitem text="Exc" value="1"></asp:listitem>
<asp:listitem text="Good" value="2"></asp:listitem>
<asp:listitem text="Avg" value="3"></asp:listitem>
</asp:radiobuttonlist>
<asp:textbox id="txt" runat="server" ></asp:textbox>
javascript function
function chk()
{
if(document.getElementById('rbtn_0').checked)
{
document.getElementById('txt').disabled=false;
document.getElementById('txt').focus();
}
else
{
document.getElementById('txt').disabled=true;
document.getElementById('txt').value='';
}
}
please don't forget to vote on the post that helped you.
modified on Friday, June 27, 2008 3:23 AM
|
|
|
|
|
Hi i am using gridview selection index change event...,
when i click a cell value, those values coming to my textbox,
same time page getting refresh...,
So which row i selected from the gridview its going down...,
using scrollbar i am seeing which one is selected...,
instead of that how to maintain gridview which one has been selected...,
Gridview Maintain Selected row after Postback
it mean its have to be auto scroll and have to point the place which row has been selected...,
how to do this?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
modified on Friday, June 27, 2008 1:18 AM
|
|
|
|
|
Is the gidview inside a scrolling pane(whatever) or the scroll bar you talking about is the browser's scroll bar?
|
|
|
|
|
hai sherin,
me too the same problem in all case (textbox, gridview).
i speaking about Browser's scroll bar.
help me - KARAN
thanks in advance
|
|
|
|
|
Can you use
MaintainScrollPositionOnPostback=true
at page directive
|
|
|
|
|
Thanks a lot sherin.
it helps me a lot and i implemented
Thanks for understanding!
|
|
|
|
|
I want to call a java script function when my web page is loaded. What I have to do this. I tried like this...........
But I am getting error such like, funEnableTxtBox is not a member of asp.net
What I have to do?. Thanks in adv.
Balasubramanian K.
|
|
|
|
|
BalasubramanianK wrote: funEnableTxtBox is not a member of asp.net
I highly doubt that was the error. Perhaps if you post the actual message, we can help more ?
Where does this function come from ?
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 )
|
|
|
|
|
'funEnableTxtBox' is not a member of ASP.frmBAFeedback. This is the actual error, I faced.
I have written my function in design page-source view of frmBAFeedback.aspx file
function funEnableTxtBox()
{
if(document.getElementById("rbRndQRSSPoor").checked==true)
{
var a;
a=document.getElementById("mstxtRndPoor1").value;
if (a == "")
{
alert("Please enter the reason for poor.");
document.getElementById("mstxtRndPoor1").focus()
return false;
}
}
}
I called this fun by other way (onClick event of radiobutton). It is working fine. But I need, "Is there any option to call this function when page loads?"
Balasubramanian K.
|
|
|
|
|
What new one suggested is what I was going to suggest, too
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 )
|
|
|
|
|
Yes. It is working fine. Tnx
Balasubramanian K.
|
|
|
|
|
use that onload event in body tag
it mean call that javascript function in body onload event
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Thank you Mr. It is working fine
Balasubramanian K.
|
|
|
|
|
hi all i am displaying the data in treeview control dynamically from the database.....
i have the parent node and child nodes and i want to edit those parent node and child nodes..now i want to place the add button and edit button for that tree control beside of the each node or below of that nodes,,,,,,how can i do this in asp.net?
|
|
|
|
|
I am trying to Validate fields in a details view. But when I fire the save method, even if the fields are invalid the validation text/summary will not be displayed. It will only disaply if i cancel the save event in the pre update event. But I don't want to do this.
Any ideas on using validation with a DetailsView / GridView
cheers
|
|
|
|
|
Error Description:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +905
localhost.CommonPage.Page_Init(Object sender, EventArgs e) +56
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnInit(EventArgs e) +67
System.Web.UI.Control.InitRecursive(Control namingContainer) +241
System.Web.UI.Page.ProcessRequestMain() +197
Hi,
i am receiving the above error while accessing on eapplication throuh a link in the main application.
but when i give direct URL to access the applciation i am able to access it.
Please provide me some solution.
|
|
|
|
|
Set a breakpoint in that page init method, and see what's going wrong.
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 )
|
|
|
|
|
Exam certificacion question
Ive seen this question in more than one simulator with C,D and also B,D or even just B as answers, what do you think would be the correct one and why?
You create a Web Form. You need to add controls that use adaptive rendering to display content. The type of content rendered must depend on the device that is requesting the page. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Add custom controls that emit XHTML to the Web Form.
B. Add custom controls that emit WML to the Web Form.
C. Add mobile controls to the Web Form.
D. Add Web server controls to the Web Form.
Answer: C, D
Alexei Rodriguez
|
|
|
|
|
I guess "D" is the one. Webserver control knows how to render for different requesting browsers. If you add mobile controls, it won't work with normal browsers AFAIK.
|
|
|
|
|
1-listbox -
2-textbox1-textbox2-textbox3 -
-
3-link-DeleteComponent -
-
4-Link Button AddRange textbox -
--------------------------------------
5-Link Button AddComponent
I have above sinario. One coplete component include 5 parts. complete component is creating dynamically. I put complete component in ascx file. when I add it in the aspx file it is adding correctly. but when I click no.4 addrange the textboxes are creating only in the last component either I click in first component or in last component. Could you please help fix this issue.
|
|
|
|