• Post Reply Bookmark Topic Watch Topic
  • New Topic

javascript does not run when invoked  RSS feed

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

when this javascript is executed, it works fine upto alert("hello 4") , but does not display alert("hello 5"). why is that ? What does the script "theForm.value = question.replace(/<%=replace_regex%>/g, ""); " do ?

Code that invokes this javascript is

In javascript where there is "theForm.value", originally it was "theForm.question_box.value". But at that time , the code will not process beyond alert("hello 2a")

Please explain how to run this code ?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well the form does not have a value.

You are calling



when you want to be calling




Eric
 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am calling "document.searchForm.value"
While I should be calling "document.searchForm.question_box.value", is that what you mean to say ?

When its called like this, the javascript does not execute beyond alert "Hello 2a"

Can you explain why ? And how to execute this script fully ?

thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should have a JavaScript error. Firebug or the error console should give you the value.

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!