So i have this two views :
1.
viewarea.scala.html
@(name:String, tags:String, id:String)
@Main("Area") {
....
<ul id="areaFeat">
//the ul that I want to fill
</ul>
</div>
}
2.
areaDescription.scala.html
@(id:String)
@Main("Description Area"){
<form action="@routes.Application.PostAreaDescription(id)" method="POST">
<textarea cols="40" rows="5" class="form-control" name="textarea"></textarea>
<input type="submit" id="postDescArea">
</form>
<script>
$(document).ready(function(){
$('#postDescArea').click(function(){
alert("clicked...");
$("#areaFeat").append('<li><a href="@routes.Application.viewDescription(id)">Description</a></li>');
});
});
</script>
}
I just want that li
element to be added to the ul
(from the first view) when that button is pushed.
My alert
goes on ... but I can't append the li
... I do not know what I am doin' wrong ... Can someone please help ?
Thank you !