Hi,
I am using one Legend for one section of Filtering that contains one button also and i want to put some validation in that section on that button's click event but when i calls the javascript function on Button click event runtime Exception occurs, So where is the problem... The error i am getting is "run time exception Object Excepted "...
28 2633 gits 5,390
Expert Mod 4TB
without posting the code related to that problem it would be guesswork for anybody to give you an answer ... so please post the related code ...
kind regards
without posting the code related to that problem it would be guesswork for anybody to give you an answer ... so please post the related code ...
kind regards
My code of javascript is given below, -
function CheckFilterDates(f)
-
{
-
-
if(!(f.ctl00_ContentPlaceHolder1_txtsortFrom.text==""))
-
{
-
-
if(f.ctl00_ContentPlaceHolder1_txtsortTo.text=="")
-
{
-
alert("Please Enter The Value of Remaining Date");
-
return false;
-
}
-
}
-
-
if(!(f.ctl00_ContentPlaceHolder1_txtsortTo.text==""))
-
{
-
if(f.ctl00_ContentPlaceHolder1_txtsortFrom.text=="")
-
{
-
alert("Please Enter The Value of Remaining Date");
-
return false;
-
}
-
}
-
}
-
I have also used "getElementById" but it's still giving me same error...
gits 5,390
Expert Mod 4TB
do you have a formelement with: - name = "ctl00_ContentPlaceHolder1_txtsortFrom"
in your case or: - id = "ctl00_ContentPlaceHolder1_txtsortFrom";
when you use getElementById();?
kind regards
do you have a formelement with: - name = "ctl00_ContentPlaceHolder1_txtsortFrom"
in your case or: - id = "ctl00_ContentPlaceHolder1_txtsortFrom";
when you use getElementById();?
kind regards
Yes my formelement id is - id = "ctl00_ContentPlaceHolder1_txtsortFrom";
and i am using f.id, instead of this i also tried the getElementById() but in the both case i am getting the same error....
so where is the problem ??
i am calling this function with button's onclick event...
gits 5,390
Expert Mod 4TB
in case the id is correct, which you could check when having a look at the rendered page (just use view source in the browser) and search for your formelement with that id ... then: - var id = 'ctl00_ContentPlaceHolder1_txtsortFrom';
-
var n = document.getElementById(id);
-
have to give you a reference to that node for variable n. could you please post the call of document.getElementById() and the rendered code for your node?
kind regards
in case the id is correct, which you could check when having a look at the rendered page (just use view source in the browser) and search for your formelement with that id ... then: - var id = 'ctl00_ContentPlaceHolder1_txtsortFrom';
-
var n = document.getElementById(id);
-
have to give you a reference to that node for variable n. could you please post the call of document.getElementById() and the rendered code for your node?
kind regards
Ya it's true, but the same thing is working well with button outside of <fieldset> means the button which is outside the legend, the problem is not with the id because if i callls simple blank function without body then also it giving me same error.... means if i calls -
function CheckDate(f)
-
{
-
alert("Date");
-
}
-
then also it is giving me same error...
so where is the problem ? please suggest me where is the problem ?
gits 5,390
Expert Mod 4TB
hmmmm ... is any other action triggered with the button click? do you have a testpage where i could have a look at? how are the event-handlers attached to the buttons?
kind regards
hmmmm ... is any other action triggered with the button click? do you have a testpage where i could have a look at? how are the event-handlers attached to the buttons?
kind regards
No, Only one action is triggered with Button click.... that is -
-
btnFilter.Attributes.Add("Onclick", "return CheckFilterDates(this.form)")
-
and my button is within the fieldset, -
<fieldset>
-
<legend>Filter</legend>
-
<asp:Button ID="btnFilter" runat="server" Text="Filter" />
-
</fieldset>
-
I am not getting from where this error occurs....
gits 5,390
Expert Mod 4TB
are you sure that your parameter this.form is correct here?
are you sure that your parameter this.form is correct here?
Yes i am using this.form with another button attributes and working proper.... i have also tried only this but still getting same error....
gits 5,390
Expert Mod 4TB
what about using no param at all? does the problem persist in that case? ... could you try the application in FF and have a look at the error-console ... probably we get a much better error description with that ...
kind regards
what about using no param at all? does the problem persist in that case? ... could you try the application in FF and have a look at the error-console ... probably we get a much better error description with that ...
kind regards
Yes i also tried the no param but still i getting the same error, FF i have not tried yet...
gits 5,390
Expert Mod 4TB
have you tried it now? what does the console says? ...
kind regards
have you tried it now? what does the console says? ...
kind regards
Yes it works well in FF, so now how to debug my problem in IE...? and this problem is only occurs with button which is within the legend...
gits 5,390
Expert Mod 4TB
... do you have a link to a testpage? or could you post the html source when it is laoded to IE ... have a look at view source in the browser and paste the code here ... so that we may see the code and test it?
kind regards
... do you have a link to a testpage? or could you post the html source when it is laoded to IE ... have a look at view source in the browser and paste the code here ... so that we may see the code and test it?
kind regards
Yes i have link for that page and source code of that all legend is given below, -
<fieldset>
-
<legend style="color:Maroon; font-size:medium;">Filters</legend>
-
<table class="content" width="100%">
-
<tr>
-
<td width="5%">
-
<span id="ctl00_ContentPlaceHolder1_lblsortfname">FName</span>
-
</td>
-
<td width="30%">
-
<input name="ctl00$ContentPlaceHolder1$txtsortFName" type="text" id="ctl00_ContentPlaceHolder1_txtsortFName" />
-
</td>
-
<td width="5%">
-
<span id="ctl00_ContentPlaceHolder1_lblsortlname">LName</span>
-
</td>
-
<td width="30%">
-
<input name="ctl00$ContentPlaceHolder1$txtsortlname" type="text" id="ctl00_ContentPlaceHolder1_txtsortlname" />
-
</td>
-
<td width="5%">
-
<span id="ctl00_ContentPlaceHolder1_lblsortstatus">Status</span>
-
</td>
-
<td width="10%">
-
<input name="ctl00$ContentPlaceHolder1$txtsortstatus" type="text" id="ctl00_ContentPlaceHolder1_txtsortstatus" />
-
</td>
-
<td width="5%">
-
<span id="ctl00_ContentPlaceHolder1_lblsortlofficer">L.O.</span>
-
</td>
-
<td width="10%">
-
<input name="ctl00$ContentPlaceHolder1$txtsortlofficer" type="text" id="ctl00_ContentPlaceHolder1_txtsortlofficer" />
-
</td>
-
-
</tr>
-
-
<tr>
-
<td>
-
<span id="ctl00_ContentPlaceHolder1_lblsortFrom">From</span></td>
-
<td>
-
<input name="ctl00$ContentPlaceHolder1$txtsortFrom" type="text" id="ctl00_ContentPlaceHolder1_txtsortFrom" style="width:70px;" />
-
<img id="imgFrom" src="../../images/calendar.gif" alt="" onclick ="showCalendarControl(ctl00$ContentPlaceHolder1$txtsortFrom)" />
-
</td>
-
-
<td>
-
<span id="ctl00_ContentPlaceHolder1_lblsortTo">To</span></td>
-
<td>
-
<input name="ctl00$ContentPlaceHolder1$txtsortTo" type="text" id="ctl00_ContentPlaceHolder1_txtsortTo" style="width:70px;" />
-
<img id="imgTo" src="../../images/calendar.gif" alt="" onclick ="showCalendarControl(ctl00$ContentPlaceHolder1$txtsortTo)" />
-
</td>
-
-
<td colspan="4" align="right">
-
<input type="submit" name="ctl00$ContentPlaceHolder1$btnFilter" value="Filter" id="ctl00_ContentPlaceHolder1_btnFilter" />
-
</td>
-
</tr>
-
</table>
-
</fieldset>
-
and my Validation is on the Filter Button...
... do you have a link to a testpage? or could you post the html source when it is laoded to IE ... have a look at view source in the browser and paste the code here ... so that we may see the code and test it?
kind regards
Sorry that i don't know about how to post code in proper format...
gits 5,390
Expert Mod 4TB
hi ...
i just cannot see something wrong ... could you give the link to the testpage ... so that we could test it online?
kind regards
hi ...
i just cannot see something wrong ... could you give the link to the testpage ... so that we could test it online?
kind regards
Means about which link you are asking ? we still not put it online, my project is still in developing face...
gits 5,390
Expert Mod 4TB
Yes i have link for that page ...
sorry ... i thought you had a link to test the page online ... so that problem seems to be strange ... let me summarize:
1. IE gives you the error FF does not und works properly?
2. only when the button is placed within the fieldset? even when you call an empty handler function?
3. the only javascript code that gets executed onclick is the onclick-handler function assigned to the button?
did you test it on different machines and IEs? may be its a problem with your local IE installation?
kind regards
sorry ... i thought you had a link to test the page online ... so that problem seems to be strange ... let me summarize:
1. IE gives you the error FF does not und works properly?
2. only when the button is placed within the fieldset? even when you call an empty handler function?
3. the only javascript code that gets executed onclick is the onclick-handler function assigned to the button?
did you test it on different machines and IEs? may be its a problem with your local IE installation?
kind regards
Ok i will try on diifferent machine and than i will tell....
Thanks...
Hi,
it's also giving the same error on the different machine....
sorry ... i thought you had a link to test the page online ... so that problem seems to be strange ... let me summarize:
1. IE gives you the error FF does not und works properly?
2. only when the button is placed within the fieldset? even when you call an empty handler function?
3. the only javascript code that gets executed onclick is the onclick-handler function assigned to the button?
did you test it on different machines and IEs? may be its a problem with your local IE installation?
kind regards
Hi,
You was right now my all validation for buttons giving me same error that is js runtime error... so what can i do, should i reinstall IE ???
gits 5,390
Expert Mod 4TB
nope not yet :) ... could you get alerts in your validation functions? if that is the case you should start to trace the elements that are used ... i mean whenever you use a html-node-reference just alert its tagName to see whether this works or not ... may be you could track the error this way? since you don't have a test-link i don't know what i could recommend instead ... since IE's js-debugging abilities are very limited ... may be tha MS IE Script Debugger may help?
nope not yet :) ... could you get alerts in your validation functions? if that is the case you should start to trace the elements that are used ... i mean whenever you use a html-node-reference just alert its tagName to see whether this works or not ... may be you could track the error this way? since you don't have a test-link i don't know what i could recommend instead ... since IE's js-debugging abilities are very limited ... may be tha MS IE Script Debugger may help?
No i am not getting any alert also...in all the reference nodes it's giving the same error that is runtime js error... even if i calls simply without parameterized function and if i puts simple alert then also i m getting the same runtime js error...
gits 5,390
Expert Mod 4TB
could you try to avoid
and write an onclick directly to the tag ... does the error persist in that case?
kind regards
could you try to avoid
and write an onclick directly to the tag ... does the error persist in that case?
kind regards
No i have not tried it yet.... ok i will try this and then i will reply...
thanks...
could you try to avoid
and write an onclick directly to the tag ... does the error persist in that case?
kind regards
Hi gits,
Sorry for late reply but my problem is solved yesterday i was working on another module for 20-22 days that's why i have not reply, i have reinstall the IE7 and now it's working well.... thanks for your kind response....
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Carsten |
last post by:
Hi,
I have a problem with instantiating a Web service. When the constructor for
the proxy is called a SEHException is thrown. The call stack is shown below:
...
|
by: SHC |
last post by:
Hi all,
I did the "Build" on the attached code in my VC++ .NET 2003 - Windows XP Pro
PC. On the c:\ screen, I got the following: Microsoft Development Environment
An unhandled exception of type...
|
by: Peter Steele |
last post by:
We have an application that when it runs in the IDE in debug mode an
unhandled exception is occurring in a system header file associated with STL
stirngs. The actual statement that crashes is
...
|
by: Nick Flandry |
last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my
development environment (Win2K server running IIS 5) and a test environment (also Win2K server
running IIS...
|
by: IdleBrain |
last post by:
Hello All:
I have a project deployed to a client.
The client reports me of a runtime exception occuring some times:
Arithmetic Overflow
It does not occur on my machine where I have the source...
|
by: Larry Herbinaux |
last post by:
I have built an asychronous TCP Server that uses the thread pool. I have two
levels of exception handling in case the handling of the inner catch block
throws an exception. The outer catch block...
|
by: =?Utf-8?B?R3JhaGFt?= |
last post by:
I've added 2 tracking services to the wf runtime; one is the standard
SqlTrackingService:
trackingService = new
SqlTrackingService(<trackingConnectionString>);
<workflow...
|
by: =?Utf-8?B?UGF1bA==?= |
last post by:
in event log:.NET Runtime version 2.0.50727.312 - Fatal Execution Engine
Error (7A062A61) (80131506)
We have an application that seems to be throwing this error, but I can't
seem to work out why...
|
by: =?Utf-8?B?VGhvbWFzIFR1dGtv?= |
last post by:
An ASP.NET web project has recently began crashing WebDev.WebServer.exe with
a System.Runtime.InteropServices.SEHException. The EventLog for the crash
looks like this:
Application ID:...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |