1
iunderwood
Insert HTML within a form.

I am curious to know if there is a way to insert some HTML between elements when using forms created with the XoopsForm class.

I'm working on a pretty long form, and I would find it useful to be able to insert a horizontal rule and some text describing the section of the form. I could do the form as part of a smarty template, but I'd rather use the class for the time being.

I'm thinking something like:
$html "<hr><p>This is a different part of the form.</p>";
$form->addElement(new XoopsFormHTML($html));


Ideas?
++I;
Resized Image

2
culex
Re: Insert HTML within a form.
  • 2009/7/31 8:05

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


you can always use the

XoopsFormLabel($caption="", $value="")

With this you can print text only :)
Programming is like sex:
One mistake and you have to support it for the rest of your life.

3
frankblack
Re: Insert HTML within a form.
  • 2009/7/31 9:09

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


XoopsFormLabel is not always optimal, because it uses two cells in the table row. If you want to have a table row with only one cell use:
$form->insertBreak('<hr /><p>This is a different part of the form.</p>''nameofcssclassifyoulike');

4
culex
Re: Insert HTML within a form.
  • 2009/7/31 12:12

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


yes even better :)
Programming is like sex:
One mistake and you have to support it for the rest of your life.

5
iunderwood
Re: Insert HTML within a form.

insertBreak was exactly what I was looking for!

However, I'm going to write down both methods in my notebook on forms. :) Thanks to both of you for your assistance!
++I;
Resized Image

Login

Who's Online

195 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 195


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits