I'm trying out jQuery in an MVC3 ASP.NET app but I'm struggling with the model aspects.
This is not working:
I've declared a TextBox Watermark library:
<script src="../../Scripts/jquery.tinywatermark-3.1.0.js" type="text/javascript"></script>
I then add my jQuery:
<script type="text/javascript">
$(function () {
$('.watermarked').watermark('watermark', 'Please Enter...');
});
</script>
Then add the watermarked class to my div model field:
<div class="editor-field">
@Html.EditorFor(model => model.SchemeName, new { @class = "watermarked" })
@*<input class="watermarked" @Html.EditorFor(model => model.SchemeName) />*@
@Html.ValidationMessageFor(model => model.SchemeName)
If I uncomment the section it sort of works but I want to maintain the Razor model, any ideas, anyone?