There's nothing complicated here. Do the layout, stylisy and so on. Then do all the necessary form elements and hide them. Hang events to the layout elements and make the appropriate values to hidden form elements. It is not clear what you mean by validity, but hypertext markup language code get the usual and css is also not valid here to be nothing if you yourself don't fuck up.