Page 1 of 1

Populate iframe fields

PostPosted: Wed Jan 23, 2019 7:53 pm
by hansg
Hi,

I have a webform which sends data to my CRM. I have placed the link to the webform in an iframe so that it appears on the agents script page.

I need the customers name, phone number and address etc. to automatically fill my form so that the agent does not have to fill in all of the details.

My Script iFrame
Code: Select all
<iframe src=http://serverip/form.php?customer_phone_c=--A--phone_number--B--&newtitle_c=--A--title--B--&newfirstname_c=--A--first_name--B--&newsurname_c=--A--last_name--B--&address_1_c=--A--address1--B--&address_2_c=--A--address2--B--&address_3_c=--A--address3--B--&postcode_c=--A--postal_code--B--&agent_name_c=--A--fullname--B--" style="background-color:transparent;" scrolling="yes" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="--A--script_width--B--" height="--A--script_height--B--" STYLE="z-index:17"></iframe>


Extract from my form:
Code: Select all
<td style="text-align: left; font-size: 12px; font-weight: normal;" width="15%"><span>Customer Phone: </span></td>
<td style="font-size: 12px; font-weight: normal;" width="35%"><span><input id="customer_phone_c" type="text" name="customer_phone_c" /></span></td>



Can someone give me a point in the right direction. I had this working previously but can't remember what i done.

Re: Populate iframe fields

PostPosted: Wed Jan 23, 2019 9:33 pm
by williamconley
Assuming linux server running apache with php. Also assuming the form's filename ends in ".php" to invoke the php parser. Here's the customer phone input value being 'dropped in' to the input during page load:
Code: Select all
<input id="customer_phone_c" type="text" name="customer_phone_c" value="<?PHP echo $_REQUEST['customer_phone_c']; ?>" />

Re: Populate iframe fields

PostPosted: Thu Jan 24, 2019 1:43 pm
by hansg
williamconley wrote:Assuming linux server running apache with php. Also assuming the form's filename ends in ".php" to invoke the php parser. Here's the customer phone input value being 'dropped in' to the input during page load:
Code: Select all
<input id="customer_phone_c" type="text" name="customer_phone_c" value="<?PHP echo $_REQUEST['customer_phone_c']; ?>" />


You assume correctly! Added the above PHP Request and got everything working perfectly.

Thanks William!