Frontend users and field validation

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
Masweb
Forum Members
Forum Members
Posts: 173
Joined: Sat May 09, 2009 4:26 pm

Frontend users and field validation

Post by Masweb »

I saw some questions about this but didn't found any answers. :(

Is there a possibility to use some validation on the form field in the Frontend users module?

One of the filed has to be numeric and another filed has to check a bank number?

Thanks
Masweb
Forum Members
Forum Members
Posts: 173
Joined: Sat May 09, 2009 4:26 pm

Re: Frontend users and field validation

Post by Masweb »

Meanwhile I've make a change on the registrationtemplate with Javascript. With this I get a popup screen that displays the error. Instead of returning to the form it is still sent. Where can I find the error handling of the form?

Code: Select all

{* registration 1 template *}
{* $title *}
{if isset($message) && $message != ''}
  {if isset($error) && $error != ''}
    <p><font color="red">{$message}</font></p>
  {else}
    <p>{$message}</p>
  {/if}
{/if}
[color=#FF0000]{literal}
<__script__ type='text/javascript'>
function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}
</__script>
{/literal}[/color]{$startform}
{if $controlcount > 0}

{foreach from=$controls item=control}
<div class="zrf">
    <div class="zrf-label">{if isset($control->hidden)}{$control->hidden}{/if}
    {if $control->color != ''}
      <font color="{$control->color}">{$control->prompt}{$control->marker}</font>
    {else}
      {$control->prompt}{$control->marker}
    {/if}
    </div>
    <div class="zrf-input">{$control->control}</div>
</div>
{/foreach}
<br/>
{/if}
{if isset($captcha)}
{$captcha_title}: {$input_captcha}<br />
  {$captcha}<br />
{/if}
 {$hidden|default:''}{$hidden2|default:''}[color=#FF0000]<input class="cms_submit" name="m92bb4sr_submit" id="m92bb4sr_submit" value="Verstuur" type="submit" onclick="isNumeric(document.getElementById('m92bb4sr_input_kvk_nummer'), 'Numbers Only Please')" />[/color]<br/>
<p>{$msg_sendanotheremail}&nbsp;{$link_sendanotheremail}</p>
{$endform}

User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Frontend users and field validation

Post by Dr.CSS »

{if isset($message) && $message != ''}
{if isset($error) && $error != ''}
<p><font color="red">{$message}</font></p>
{else}
<p>{$message}</p>
{/if}
{/if}
Locked

Return to “Modules/Add-Ons”