A very similar, but significantly different question is LyX command(s) to insert WYSIWYG horizontal line, for keyboard shortcut.
I'm trying to achieve the effect of \hrulefill in LyX, without resorting to an ERT (TeX code inset).
The example is the following:
Name and section:\enspace\hrulefill
All of the Width: options for Insert>Formatting>Horizontal Rule don't seem to achieve the same effect as \hrulefill, since they require a % of, or some fixed width, and aren't as dynamic. Is there some way to achieve this using the LyX interface?

\hrulefill. However, the feedback in the document is not so clear (I just see a vertical bar). If I add a character after, LyX will draw the underline all the way to the right margin (where my character also is). Is there a way to make it more obvious in the GUI without adding that character? Perhaps this is a LyX bug? – Fuhrmanator Jul 25 '16 at 15:02