[eluser]mehwish[/eluser]
I can expalin my context to you please consider it and tell me the solution.
Actually i have a controller "my_controller" and from it i am loading view "my_view" and i have also included some jquery functions in "my_view" like this:
my_view.php
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
[removed]
</head>
<body>
<h2>type your query: </h2>
<div><textarea cols="50" rows="4" name="query_box" id="textbox"></textarea></div><br/>
<div>
<input type='button' value='Add Button' id='addButton'>
<input type='button' value='Remove Button' id='removeButton'>
<input type='button' value='Get TextBox Value' id='getButtonValue'>
<input type='button' value='doneButtonvalue' id='doneButton'>
</div>
[removed]
var counter=2;
var m='';
$(document).ready(function() {
$("#addButton").click(function(){
counter++;
$(this).before(/*'<h4>box'+counter+'</h4>*/'<input type="textbox" name="textbox' + counter + '" id="textbox' + counter + '" value="textbox'+ counter + '" /><br/>')
m=$('#textbox' + counter).val();
alert(m);
});
});
[removed]
now I want to return "m" and "counter" values so that i can access them through my controller or if not from controller atleast i can echo "m" and "counter" outside the script tag in the same view file. I hope you got my point ... please tell me how it can be done ?