i have the this form:
<form id="segform" action="TestServlet" method="POST" >
<div id="actives" class="rounded-corners">
<div class="column">
<div class="portlet"><a href="#">link1</a></div>
</div>
</div>
<div id="inactives" class="rounded-corners">
<div class="column">
<div class="portlet"><a href="#">link2</a></div>
</div>
</div>
<input type="hidden" name="ffactives" value="foovalue" />
<input type="hidden" name="ffinactives" value="foovalue" />
<input type="submit" />
</form>
I need when the form was submitted the content of links being set into input:
ffactives = "link1" instead of "foovalue" ffinactives = "link2" instead of "foovalue"
i use now the jquery code:
$('#segform').submit(function(){
var act = $('#actives div.column div.portlet a').text();
var inact = $('#inactives div.column div.portlet a').text();
$('input[name=ffactives]').val(act);
$('input[name=ffinactives]').val(inact);
return true;
});
But when i receive the inputs the values was not changed. i aspect ffactives = "link1" and ffinactives = "link2" , but i receive ffactives = "foovalue" and ffinactives = "foovalue"
Whats wrong