Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I include an element in a form but separate it physically in the layout

So given a layout like so:

enter image description here

How can I include the value of ComboBox in the submission of the form.

Things that have occurred to me:

  1. Include the combo box as part of the form in terms of markup and position it absolutely. I'm don't get how this would work if the page needs to resize and the combo should remain where it it is in this title bar.
  2. On submission use JS to grab the value and insert it in a hidden field as part of the form submission. This would clearly break without JS but the page is client facing and we are willing to stipulate that JS is required.

I believe I have stated all the restrictions so given that is there another approach? If not how should I choose between the above options?

like image 308
JimmyP Avatar asked Dec 11 '25 22:12

JimmyP


1 Answers

You obviously could use a a giant form tag.

OR

Two forms, changing the combo and submitting does a full post and adds a hidden to the main form. Then sexy it up with JavaScript (prevent the full post back, and remove the submit button on the combo form)

OR

CSS Positioning as you suggest.

like image 132
tarn Avatar answered Dec 14 '25 11:12

tarn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!