• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: no extra code around hidden fields

no extra code around hidden fields 12 years 7 months ago #19297

  • hans2103
  • hans2103's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 6
Using Inline(XHTML) as layout I receive the following layout for a formfield
<li class="rsform-block rsform-block-pakket">
<div class="formCaption">{pakket:caption}</div>
<div class="formBody">{pakket:body}<span class="formClr">{pakket:validation}</span></div>
<div class="formDescription">{pakket:description}</div>
</li>

When my form field type = hidden I only need the body
The only needed layout for a hidden form field is:
{pakket:body}

the reason for this is that there might be (in my case there is) css be interfering with the layout adding some not needed margin and padding for hidden fields. Hidden fields should not take any place.

What kind of RSFormPro core hack is needed to get this result?
The administrator has disabled public write access.

Re: no extra code around hidden fields 12 years 7 months ago #19311

  • renekreijveld
  • renekreijveld's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Thank you received: 7
This would be a great addition!
René Kreijveld, Joomla! specialist
The administrator has disabled public write access.

Re: no extra code around hidden fields 12 years 7 months ago #19312

  • renekreijveld
  • renekreijveld's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Thank you received: 7
I thought of a workaround. For hidden fields you could indicate in the fieldname that this is a hidden field.
So instead of using for example a fieldname like "counter", you name that field "counter_hidden".

In the layouts used for RSFormPro (/administrator/components/com_rsform/layouts) you could anticipate on this.
For example in the inline XHTML layout (/administrator/components/com_rsform/layouts/inline-xhtml.php) you read the following code on lines 44 - 48:
$out.="\t".'<li class="rsform-block rsform-block-'.JFilterOutput::stringURLSafe($quickfield).'">'."\n";
	$out.= "\t\t".'<div class="formCaption">{'.$quickfield.':caption}'.$required.'</div>'."\n";
	$out.= "\t\t".'<div class="formBody">{'.$quickfield.':body}<span class="formClr">{'.$quickfield.':validation}</span></div>'."\n";
	$out.= "\t\t".'<div class="formDescription">{'.$quickfield.':description}</div>'."\n";
	$out.="\t".'</li>'."\n";
Change this to the following code:
if (strtolower(substr($quickfield,-7)) == "_hidden") {
		$out.= "{".$quickfield.":body}\n";
	} else {
		$out.="\t".'<li class="rsform-block rsform-block-'.JFilterOutput::stringURLSafe($quickfield).'">'."\n";
		$out.= "\t\t".'<div class="formCaption">{'.$quickfield.':caption}'.$required.'</div>'."\n";
		$out.= "\t\t".'<div class="formBody">{'.$quickfield.':body}<span class="formClr">{'.$quickfield.':validation}</span></div>'."\n";
		$out.= "\t\t".'<div class="formDescription">{'.$quickfield.':description}</div>'."\n";
		$out.="\t".'</li>'."\n";
	}
Good luck!
René Kreijveld, Joomla! specialist
Last Edit: 12 years 7 months ago by renekreijveld.
The administrator has disabled public write access.
The following user(s) said Thank You: layton

Re: no extra code around hidden fields 12 years 2 months ago #21738

  • lausianne
  • lausianne's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 30
  • Thank you received: 3
Addition? I'd call it a bugfix. And as you have shown, not a difficult one.

EDIT: I applied this now and it works nicely, thanks Rene. Yet it is not *the* solution. It would be nicer if the _hidden was not needed in the parameter name, and if all hidden fields appeared outside of the fieldset. I briefly tried to remove it, but found that this needs changes in various files, so I dropped it. Hoping for a real solution from rsjoomla someday ...
Last Edit: 12 years 2 months ago by lausianne.
The administrator has disabled public write access.

Re: no extra code around hidden fields 12 years 3 weeks ago #22651

  • layton
  • layton's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Worked for me too in the responsive CSS layout. Many thanks!
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!