Click here to Skip to main content
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 1:52am
Edited 17-Jul-12 2: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 498
1 OriginalGriff 439
2 ChintanShukla 305
3 Richard Deeming 250
4 RyanDev 210
0 Sergey Alexandrovich Kryukov 8,901
1 OriginalGriff 7,571
2 CPallini 2,603
3 Richard MacCutchan 2,095
4 Abhinav S 1,893


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