+ 1

In a form, can an input be nested?

can I add one input into another? I want to create a search area(bar for text) and a search bottom (submit) beside it in the bar..

24th Jun 2017, 12:49 PM
Otumian Empire
Otumian Empire - avatar
5 Answers
+ 12
<form> <!-- Search Bar --> <input type = "search"> <!-- Submit --> <input type = "submit"> </form> Then, use the CSS positioning to move your elements, in this case you have two input tag one beside the other one... because their default value for the display property is "inline" ;)
24th Jun 2017, 1:00 PM
Maz
Maz - avatar
+ 9
Yes, you can set the Search input as "relative" and the button input as "absolute" to put it inside the Search bar, then use the properties (top, left, right, bottom) to move your elements. EDIT - I made a DEMO with an easiest solution, take a look here: https://code.sololearn.com/WRO7E7bl2f5i/?ref=app
24th Jun 2017, 1:20 PM
Maz
Maz - avatar
+ 3
you are implying I position the submit button in the search box, right? and then position it to the desired position?
24th Jun 2017, 1:19 PM
Otumian Empire
Otumian Empire - avatar
+ 2
Nesting is not really supported as far as I know. Though, you can position the button absolutely.
24th Jun 2017, 12:52 PM
LaserHydra
LaserHydra - avatar
0
awesome work.. thanks
24th Jun 2017, 1:47 PM
Otumian Empire
Otumian Empire - avatar