1
phillipd
What does <{$searchform.javascript}> do?
  • 2005/3/18 19:39

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I'm looking at some sample code in the xoops_members module and in one of the template files, xoopsmembers_searchform.html, there is the following code:

What exactly does the first line do? Please be very verbose.

<{$searchform.javascript}> <== This line, what does it do?
<b><{$searchform.title}></b>
<br /><br />
<form name="<{$searchform.name}>" action="<{$searchform.action}>" method="<{$searchform.method}>" <{$searchform.extra}>>
<table class="outer" cellpadding="4" cellspacing="1">
<!-- start of form elements loop -->
<{foreach item=element from=$searchform.elements}>
<{if $element.hidden != true}>
<tr>
<td class="head"><b><{$element.caption}></b></td>
<td class="<{cycle values="even,odd"}>"><{$element.body}></td>
</tr>
<{else}>
<{$element.body}>
<{/if}>
<{/foreach}>
<!-- end of form elements loop -->
</table>
</form>

2
fatman
Re: What does do?
  • 2005/3/18 20:46

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


<{$searchform.javascript}> is a Smarty tag.

Somewhere in the module PHP script which loads that form the developer is using the XoopsForm class to build all the form fields and form details. This XoopsForm was assigned to Smarty using the name 'searchform'.

All of the <{$searchform.something}> tags hold some sort of details about the form. <{$searchform.javascript}> will likely include any javascript the developer is using with thier form (most likely for validation).

If you look at the HTML source of the actual page when loaded in XOOPs you'll see that in place of <{$searchform.javascript}> there will probably be a chunk of javascript code.

Hope thats the answer you're looking for.

Login

Who's Online

72 user(s) are online (42 user(s) are browsing Support Forums)


Members: 0


Guests: 72


more...

Donat-O-Meter

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

Latest GitHub Commits