I have a form that I currently enumerate with some Javascript functionality and then post it with jQuery .ajax() to a MVC controller action. I have few questions on my options if I wanted to add traditional (no-javascript) support for posting this form.
1) The thing is I have some data that is not in fields but it is just text in divs. Since I'm currently posting with AJAX I can get the contents of these divs by their id's before posting and include them in post. I assume that this information will be missing from a traditional POST.
One idea is to make an <input>
for these divs also but hide it on page. And then use those in POST.
2) If I decide to only use AJAX post, can I get rid of the form completely?
3) Given that I stay with AJAX post, what format do you suggest to use for posting values? JSON, comma-delimited (problematic for complex data), something else?
4) Do you normally support both ways? Because if I look at my forms right now, they use a ton of jQuery and jQuery UI functionality and these would be an overkill to implement without JavaScript. How likely is it that users won't have JS enabled and is it ok to just say "JS is required"?
For this concrete case, I'm building an inhouse, on-demand application that won't be web oriented (at least not yet) so I do have an option to say that JS is required.
ty