How can i have default values for my input’s, and when user submites form, only values from changed inputs go to query, those that havent been change don’t?
I have:
@using (Ajax.BeginForm("Search", "Persons", new AjaxOptions
{
HttpMethod = "POST",
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "results",
LoadingElementId = "progress"
}))
{
<input name="Name" type="text" class="cleardefault" value="First and Last name"/>
<input name="Adress" type="text" class="cleardefault" value="Adress"/>
<input name="Search" type="submit" class="mainSearchSubmit" value="submit" />
}
I am using functions for clearing and replacing default text in
<input> elements, by Ross Shannon, http://www.yourhtmlsource.com/
My goal is to only send values that are not default? This way when i breakpoint to my controller, my query has default values inside?? Is there a way to resolve this, and still keep MVC3 native code?
Any ideas?
Full answer: from hagenburger.net
HTML
JS
CSS