asp.net mvc - How to extract data from a HTML.TextArea contained in a foreach loop using JQuery or other means -
I am new to jQuery. I have HTML. Textaria called "commentpost", which is displayed for each item in an advanced option loop. I am trying to return the data typed in my text field as a parameter in my appell call. First parameter item Commented Id is correctly populated, but second thing Commenting on the poster evaluates as zero. I thought maybe a jQuery call - when ActionLink is selected - can sort it for me, I'm trying to solve it for hours now, but I'm not getting any clue I know that < Code> $ ('#postspost'). Attr ("value") gives the correct text, but how can all this put together is beyond me please
& Lt;% = (item.UserName)%> & Lt;% = Html.TextArea ("Comment Post", Item Commenting Posting)% & gt; & Lt;% = Html.ActionLink ("Save", "Posting Comment", New {commentId = item.CommentId, commentPost = item.CommentPosting})%> & Lt;%}% & gt;
The shell of my controller code looks as follows:
[AcceptVerbs (HttpVerbs.Get)] Public functioning comment posting (int comment id, string comment page } {}
OK I solved it ... ultimately (for inspiration After praying)!
I did this:
I modified the HTML by hardcoding the value "test" for my comment post parameters and then get a new Java Script call GetData (link) on onClick Incorrect incident. This Javascript call changes the hardcoded value to the correct value:
& lt;% = html.ActionLink ("Save", "Posting Comment", New {commentId = item.CommentId, comment.post Then I created my javascript function:
GetData (link) function; New {onClick = "GetData (this);"}}%>
{Var temp = link previousElementSibling; Link.originalHref = link.originalHref || Link.href; Link.href = link.originalHref.replace ("test", $ (temp) .attr ("value")); Return true; }
Good luck all this works now!
Comments
Post a Comment