FW: [PHP] Re: Populate input from another form

[email protected] ("Jen Rasmussen")
Newsgroups php.general
Organization Cetacea Sound Corp
Message-ID <005201ce1c45$09ad3330$1d079990$@com>
Are both forms on the same page? 
This is confusing because if you're populating one field with POST data and
both forms are on the same page, why wouldn't you just populate both fields
with the POST data?
Please provide more details or some actual code...

Jen

-----Original Message-----
From: John Taylor-Johnston
[mailto:[email protected]] 
Sent: Friday, March 08, 2013 2:44 PM
To: PHP-General
Subject: [PHP] Re: Populate input from another form

Scratch that, IE does not like form elements outside the </form>!!?? :,( I
can't a form within a form either, unless ... I float a div??.

John Taylor-Johnston wrote:
> I have a form
>
> <form action="CRTP_Query.php" id="CRTP_Query" method="post" 
> target="_CRTP"><input value="Query" form="CRTP_Query" 
> type="submit"></form>
>
> OnSubmit, I want to include data from another form (form="DPRform").
>
> <input name="DPRsurname" type="text" form="DPRform" size="20" 
> value="<?php echo stripslashes($_POST["DPRsurname"]);?>">
>
> I should use a hidden identical field and use form="CRTP_Query":
>
> <input name="DPRsurname" type="hidden" form="CRTP_Query" value="<?php 
> echo stripslashes($_POST["DPRsurname"]);?>">
>
> But I have no idea how to populate the hidden field with the data from 
> the viewable field. PHP cannot do this onsubmit, can it?
>
> Anyone have an example to show me please?
>
> Do I need to use jquery?


--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.