3
Reply

when javascript is executed?

Ask a question
ajay raju

ajay raju

14y
2.1k
1

hi!
i am take3 textboxes, i enter text in first textbox that textbox charcters length is displayed in 2nd textbox
(means i am writing code for send messsages. message is write in first textbox and characters left is displayed in 2nd textbox(max characters is 450).
and if user enter 0 to 150 characters,message send one time. and user enter morethan 150 upto 300 message send 2 times(1 To 150 characters are one message and 151 to remaing characters are another message)
 so message count is displayed in 3rd texbox this code is write in javascript. by default 3rd Textbox text is 1.
 
 when i enter some 250 charactes that time message count textbox display "2". it displays.
for practing i am taking one label and button, in that label i display message count text. so i write code like
label1.Text = txtMessageCount.Text;
Every time in label display "1", every time it display default value. if i enter 450 characters that time also it display Messagecount text is "1". i am execute using breakpoint this first execute button code and next go to Javascript code. but my aim is first execute javascript code and next execute button code.
 
please give a solution. and one more thing i write javascript code in child page and  function name is write in  master page that is 
<
body onLoad="TextCount();">
when  i am goto other child pages one error occured in run time i.e., Microsoft JScript runtime error: Object expected.
please give solution of these 2 problems.
Thanks
 

Answers (3)