On click of a button, firing a JS function and that too is..
Posted: Mon May 24, 2010 12:47 am
Hey everyone... how are you my friend Neo
A little tricky situation here, which is bugging my head - at a glance, brain says no its not possible. But heart says It is very possible, maybe in a different way. Need your help.
The situation is, there is one text box for entering any text, when the text is entered, you can click an ASP.NET button. Which then fires a onclick event, and that basically sets the text of textbox in to a variable. Then since the page refreshes, the variable is then called through javascript. So on first website visit, the function is called but the no value is passed as nothing is written in textbox. Then on writing into textbox and click the button calls the function and does the task.
Now, what is the situation that needs solving? I need to have many of such textboxes and many of such buttons. Each button for each textbox. And for all the buttons, there will be specific functions. Suppose, we have two textbox and two buttons and two js funtions.
Now if I enter some text into textbox1 and hit searchButton1. it works, as i've also loaded the javascript function on page load. But when I enter something on textbox2, and hit search button2, I want a specific function to load. And again, the value in textbox2 should also be passed to javascript before javascript function fires off.
I know its possible, this way or the other... its a bit tricky though.
Thanks for the intention to help!
A little tricky situation here, which is bugging my head - at a glance, brain says no its not possible. But heart says It is very possible, maybe in a different way. Need your help.
The situation is, there is one text box for entering any text, when the text is entered, you can click an ASP.NET button. Which then fires a onclick event, and that basically sets the text of textbox in to a variable. Then since the page refreshes, the variable is then called through javascript. So on first website visit, the function is called but the no value is passed as nothing is written in textbox. Then on writing into textbox and click the button calls the function and does the task.
Now, what is the situation that needs solving? I need to have many of such textboxes and many of such buttons. Each button for each textbox. And for all the buttons, there will be specific functions. Suppose, we have two textbox and two buttons and two js funtions.
Now if I enter some text into textbox1 and hit searchButton1. it works, as i've also loaded the javascript function on page load. But when I enter something on textbox2, and hit search button2, I want a specific function to load. And again, the value in textbox2 should also be passed to javascript before javascript function fires off.
I know its possible, this way or the other... its a bit tricky though.
Thanks for the intention to help!