Click here to Skip to main content
13,249,174 members (33,356 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
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
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 17-Jul-12 2:52am
Updated 17-Jul-12 3:05am
v2
Comments
Abdul Quader Mamun 17-Jul-12 7:54am
   
for line of syntax it is showing JavaScript run time error?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

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
  Permalink  
Comments
amperayani 17-Jul-12 8:00am
   
but it shows null txtfrm null and txttodt null not working
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

your id's are txtfmdt.text and txttodt.text?
one of these are returning null (i guess)

try this:
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!')
  Permalink  
Comments
amperayani 17-Jul-12 8:00am
   
both are showing null
AlluvialDeposit 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 17 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100