Forums

Save email data on submit

bonjurkes 31 May, 2011
Hello,

I would like to ask something, there is a small form on my main page (only a field for typing email), amd when guest type their email address in the box, it redirects guest to the form (made in chrono form) for filling their name surname etc.

The point is, when a user type their email address, i want it to get copied (or stored) into the email field of the signup form that guest is redirected to fill.

The code for small form on my main page is like this :

<form action="http://www.domain.com/sign-up-form.html" method="post">

						

						<table cellpadding="0" cellspacing="0" border="0" align="left">

							<tr>

								<td width="165" align="left">

									<input type="text" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;" name="email" id="email" value="email address" style="width:155px; height:20px; font-size:10px; border:1px #a1cd6d solid; color:#7b7b7b;">

								</td>

								<td>

									<input type="submit" class="join_btn" value="" >



so i created a form field (chrono form) and had a form field with id "email", but it doesnt work.


So can anyone help me with this please?
GreyHead 31 May, 2011
Hi bonjurkes,

Try getting the value with
<?php
$email = JRequest::getString('email', '', 'post');
?>
. . .
<input name='email' value='<?php echo $email; ?>' . . . />


And of cource you could use a ChronoForm for your first form too :-)

Bob
This topic is locked and no more replies can be posted.