How to send form data when validation is executed?

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
toplisek
Forum Commoner
Posts: 31
Joined: Tue Apr 11, 2006 1:23 pm

How to send form data when validation is executed?

Post by toplisek »

I have form name form1 and like to send message per this form. How to do this in PHP file (related to this tpl).

I'm using validation jQuery plugin 1.7.

http://bassistance.de/jquery-plugins/jq ... alidation/


{if $smarty.request.action == "form1"}

{nocache}
{literal}
<script type="text/javascript">
document.location='replyfile';
</script>
{/literal}
{/nocache}
{/if}
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: How to send form data when validation is executed?

Post by Jade »

You need to use ajax and post the data to the other file. Look at the jquery .post documentation.
toplisek
Forum Commoner
Posts: 31
Joined: Tue Apr 11, 2006 1:23 pm

Re: How to send form data when validation is executed?

Post by toplisek »

This assign is to set form display.

I like to know how to set values from inputs into message (mail script).

I have the following:
<p>
<label class="input1">Familiy name</label>
<input id="text1" name="{$varname}" size="60" maxlength="60" class="required" />
</p>

and assigned:
$smarty->assign('varname', $_POST['varname']);
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: How to send form data when validation is executed?

Post by Jade »

I don't know much about smarty but I suggest you take a look at the manual: http://www.smarty.net/docsv2/en/api.assign.tpl
Post Reply