Post 1 Input to Two Fields - Help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
higherhill
Forum Newbie
Posts: 3
Joined: Fri Jan 09, 2009 4:43 pm

Post 1 Input to Two Fields - Help!

Post by higherhill »

I am trying to post one input on a form to two field variables:

<input type="text" name="Contact0Phone1" value size="30">

To more than one field at the same time: both Contact0Phone1 and Contact0ContactNotes.

I need to add what someone enters into the phone field to the phone field and to the notes field using the same form.

Can't find the answer anywhere! Any ideas?

Thanks so much!
logik
Forum Newbie
Posts: 8
Joined: Fri Jan 09, 2009 4:33 pm

Re: Post 1 Input to Two Fields - Help!

Post by logik »

what? if i am sure of what you are asking it is incredibly simple

$Contact0ContactNotes = $Contact0Phone1;
higherhill
Forum Newbie
Posts: 3
Joined: Fri Jan 09, 2009 4:43 pm

Re: Post 1 Input to Two Fields - Help!

Post by higherhill »

Let me ask another way by showing code.

Here is my form. When it gets submitted, the phone input needs to input there and to another field named Contact0ContactNotes.

See code:

<form method="POST" action="https://accesshealth.infusionsoft.com/A ... ssForm.jsp">
<table width="414">
<tr>
<td width="92" align="left">First Name </td>
<font face="Arial" size="2">
<td width="312"><font face="Trebuchet MS" size="3">
<input type="text" name="Contact0FirstName" value size="30"></font></td></font>
</tr>
<font size="2" face="Trebuchet MS">
<tr>
<td width="92" align="left">
<font face="Trebuchet MS">Email </font> </td>
<font face="Arial" size="2">
<td width="312"><font face="Trebuchet MS" size="3">
<input type="text" name="Contact0Email" value size="30"></font></td></font>
</tr>
<font size="2" face="Trebuchet MS">
<tr>
<td width="92" align="left">
<font face="Trebuchet MS">Phone</font> </td>
</font><font face="Arial" size="2">
<td width="312"><font face="Trebuchet MS" size="3">
<input type="text" name="Contact0Phone1" value size="30"></font></td>
</tr>
<tr>
<td colspan="2" align="center">
<font face="Trebuchet MS" size="3">
<input name="Submit" id="Submit" value="Submit" class="button np inf-button" type="submit"></font></td>
</tr>
</table>
<input name="formid" id="formid" value="139" type="hidden">
<input name="type" id="type" value="CustomFormWeb" type="hidden">
</form>


Note: I can't edit the processForm.jsp page. It is a third party site.

Thoughts?
logik
Forum Newbie
Posts: 8
Joined: Fri Jan 09, 2009 4:33 pm

Re: Post 1 Input to Two Fields - Help!

Post by logik »

you need to use javascript: this is just a basic script

Code: Select all

 
<script language="Javascript">
  function cloneText() {
    document.myform.Conctact0ContactNotes.value = document.myform.Contact0Phone1.value;
  }
</script>
<form method="POST" name=myform action="https://accesshealth.infusionsoft.com/AddForms/processForm.jsp">
<table width="414">
<tr>
<td width="92" align="left">First Name </td>
<font face="Arial" size="2">
<td width="312"><font face="Trebuchet MS" size="3">
<input type="text" name="Contact0FirstName" value size="30"></font></td></font>
</tr>
<font size="2" face="Trebuchet MS">
<tr>
<td width="92" align="left">
<font face="Trebuchet MS">Email </font> </td>
<font face="Arial" size="2">
<td width="312"><font face="Trebuchet MS" size="3">
<input type="text" name="Contact0Email" value size="30"></font></td></font>
</tr>
<font size="2" face="Trebuchet MS">
<tr>
<td width="92" align="left">
<font face="Trebuchet MS">Phone</font> </td>
</font><font face="Arial" size="2">
<td width="312"><font face="Trebuchet MS" size="3">
<input type="text" name="Contact0Phone1" value size="30" onBlue="javascript&#058;cloneText();"></font></td>
</tr>
<tr>
<td colspan="2" align="center">
<font face="Trebuchet MS" size="3">
<input name="Submit" id="Submit" value="Submit" class="button np inf-button" type="submit"></font></td>
</tr>
</table>
<input name="formid" id="formid" value="139" type="hidden">
<input type=hidden name="Contact0ContactNotes" value="">
<input name="type" id="type" value="CustomFormWeb" type="hidden">
</form>
 
higherhill
Forum Newbie
Posts: 3
Joined: Fri Jan 09, 2009 4:43 pm

Re: Post 1 Input to Two Fields - Help!

Post by higherhill »

That worked. You rock! ;)
Post Reply