Click here to Skip to main content
15,903,523 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
JavaScript
function fn_getdays()
{

    var txtfrom = document.getElementById('txtfmdt.text').value;
    var txtodt = document.getElementById('txttodt.text').value;
    var sName1 =_Default3.GetCheckdt(txtfrom,txtodt);
    document.getElementById('txtnodt').value = sName1.value;
} 

and
JavaScript
var sName1 =_Default3.GetCheckdt(txtfrom, txtodt);

is calling ajax method every thing is correct but it is showing microsoft jscript runtime error:object required

How can i solve this?
Posted
Updated 17-Jul-12 2:05am
v2
Comments
Abdul Quader Mamun 17-Jul-12 7:54am    
for line of syntax it is showing JavaScript run time error?

try with this below textbox.text never give an object.

C#
function fn_getdays()
{
 
var txtfrom = document.getElementById('txtfmdt').value;
var txtodt = document.getElementById('txttodt').value;
var sName1=_Default3.GetCheckdt(txtfrom,txtodt);
document.getElementById('txtnodt').value = sName1.value;
}
and
var sName1=_Default3.GetCheckdt(txtfrom,txtodt) is calling ajax method
 
Share this answer
 
Comments
amperayani 17-Jul-12 8:00am    
but it shows null txtfrm null and txttodt null not working
your id's are txtfmdt.text and txttodt.text?
one of these are returning null (i guess)

try this:
JavaScript
var txtfrom = document.getElementById('txtfmdt.text');
var txtodt = document.getElementById('txttodt.text');

if(txtfrom==null)
  alert('txtfrom is null!');
if(txtodt==null)
  alert('txtodt is null!')
 
Share this answer
 
Comments
amperayani 17-Jul-12 8:00am    
both are showing null
StianSandberg 17-Jul-12 8:03am    
ok, are u sure your html elements id's are correct? Can you post your html as well?
amperayani 17-Jul-12 8:03am    
yeah correct

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900