Reputation: 534
I want to get the data of a textbox that is on a.phtml
, and the receiving action is b
and its view is b.phtml
by using the hyper link that should be in a.phtml
. How could I get this.
Example
a.phtml
<input type='text' id='username' name="username">
<a href="b">hassan</a>
b.phtml will be an iframe how could I get the value of text box by this method.
Upvotes: 0
Views: 123
Reputation: 768
If I am able to understand your problem. You can create a javascript
function
and call that from anchor tag.
function myfunction(){
var name = $('#username').val();
// use ajax here to pass your values to different action
// or if just want to redirect with data then
window.location.href = '/controller/action/param/'+ name;
}
<input type='text' id='username' name="username">
<a href="javascript:void(0)" onclick="myfunction()">hassan</a>
Not sure you are using jquery or not.
Upvotes: 1