I have this view
@if (@Model.QuestionType == 5)
{
<div data-role="fieldcontain">
@using (Html.BeginForm("SaveTextBox", "GetQuestion", Model))
{
@Html.AntiForgeryToken()
<fieldset data-role="controlgroup">
<label for="select-choice-1" class="select">@Model.QuestionText
</label>
<br />
@if (Model.Options != null)
{
foreach (var item in Model.Options)
{
<input type="text" id="textbox1" value="@item.OptionText" name="selectedObjects" />
<span id="username_warning" style="color: red"></span>
}
}
else
{
<input type="text" id="textbox1" name="selectedObjects" />
<span id="username_warning" style="color: red"></span>
}
<br />
@if (Model.Validations != null)
{
<input type="hidden" id="hiddenvalidations" value="@Model.Validations" />
}
</fieldset>
<p>
<input type="submit" id="textboxsubmit" value="Next" />
</p>
}
</div>
}
i am redirecting to the same view based on questiontype. so this loaded whenever of questiontype =5 comes.
i am reading the values in JQuery as
$("#textboxsubmit").live("click", function () {
var textvalue = $("#textbox1").val();
textvalue = jQuery.trim(textvalue);
var validations = $("#hiddenvalidations").val();
alert(textvalue);
alert(validations);
});
I am reading this values and validating the data.
its everytime giving the first loaded textbox value. why its not updating in Jquery.
whats the issue with live. how do i solve it ?