Click here to Skip to main content
11,485,982 members (76,030 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB ASP .NET
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
Edited 17-Jul-12 3:05am
v2
Comments
Abdul Quader Mamun at 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 at 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 at 17-Jul-12 8:00am
   
both are showing null
AlluvialDeposit at 17-Jul-12 8:03am
   
ok, are u sure your html elements id's are correct? Can you post your html as well?
amperayani at 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
0 Sergey Alexandrovich Kryukov 8,819
1 OriginalGriff 8,047
2 Sascha Lefèvre 3,199
3 Maciej Los 2,886
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 17 Jul 2012
Copyright © CodeProject, 1999-2015
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