Prevent values โ€‹โ€‹from being wrapped in a form

I have 4 <select></select>

items in my form. Usually when you submit the form, you will get this in the url like

index.html?day=01&month=01&year=1999&reporter=Joe+Blogs

      

However, in my interface, users switch between a date picker and a picker. Is it possible to only send values โ€‹โ€‹in an active item?

[I started writing this to send you guys, but then I thought about it and checked the disabled attribute of form elements - so in the spirit of a stack over stream I entered my own answer too]

+1


source to share


5 answers


Why did you disable this in javascript?



In any case, you have to make a server side decision, what if the server gets the user and date parameters (for example, one with javascript disabled or only jquery blocked ...)

0


source


Use .attr ("disabled", "disabled") in jQuery.



+1


source


You can put the date picker and the name picker in separate forms (perhaps with separate "Action = ...").

Simple and works in any browser.

+1


source


yes - after i did that i figured out the problem i created for non js users. I made a "todo" to split it into two shapes. I thought I was smart to turn different sets of fields on and off (trying to use the correct markup), but then, yes, filled this in. Well, in general, I learned about disabled and how to manipulate it in jQuery ...

+1


source


I would rather pass control to the server side for some kind of validation.

0


source







All Articles