Pass form variable from one web form to another

Hi,

I have a very simple form on the frontend of a Drupal website.  The form simply asks for a users email address.  What I am trying to do is then navigate the user (when they press GO) to my 'contacts us' page with their email address already populated in the 'email address field'.

<form id="newsletterForm" action="http://mydomain/contact-us" method="POST">
	<div class="input-group">
		<input class="form-control" placeholder="Email Address" name="EmailAddress" id="EmailAddress" type="text">
		<span class="input-group-btn">
			<button class="btn btn-default" type="submit">Go!</button>
		</span>
	</div>
</form>

Open in new window


Currently, with the above code, when i press GO, nothing happens.  What am i doing wrong?

Thanks
LVL 1
anthonytrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
In your controller for the contact page you need to look for the $_POST['EmailAddress'] variable and if it is present set the value of the contact us form to that value.

If you are using a plugin then the plugin would need to support this with a hook or a predefined variable name - if it does not provide support you will have to modify the plugin code or write your own handler for the contact page.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Drupal

From novice to tech pro — start learning today.