combining 2 input fields to make a 3rd
Posted: Wed Aug 10, 2011 1:27 am
I absolutely know this has to have been done before but, for the life of me, I cannot make it work no matter what I try.
Problem statement:
I need to combine the street address and zip inputs into a 3rd custom field for use with a Google Map plugin. The combination can occur either on the submission form or on the back end processing form but, through my many, many rounds of attempts today, I've seen better results on the input submission form than through the backend processing.
Here are some of the things that I've tried with comments on results:
I would show you the results from the post submit processing iterations but, as I've mentioned before, all of those attempts have not delivered the 2 fields to the custom field on WordPress.
I am desperate. Anyone who has ANY recommendations about how to do this that works will earn my gratitude for life.
Problem statement:
I need to combine the street address and zip inputs into a 3rd custom field for use with a Google Map plugin. The combination can occur either on the submission form or on the back end processing form but, through my many, many rounds of attempts today, I've seen better results on the input submission form than through the backend processing.
Here are some of the things that I've tried with comments on results:
Code: Select all
<td><input type="hidden" id="_mapfield" name="_mapfield" value="'.$_streetaddress.'" '.$_zip.'></td>-->
<td><input type="hidden" id="_mapfield" name="_mapfield" value="'<?php echo $_streetaddress?>'+'<?php echo $_zip?>'"></td> <!-- returned plus sign -->
<td><input type="hidden" id="_mapfield" name="_mapfield" value="'<?php echo $_streetaddress?>.<?php echo $_zip?>'"></td> <!-- returned one dot-->
<td><input type="hidden" id="_mapfield" name="_mapfield" value="<?php echo $_streetaddress?>.<?php echo $_zip?>"></td><!-- returned one dot-->
<td><input type="hidden" id="_mapfield" name="_mapfield" value=".<?php echo $_streetaddress?>.<?php echo $_zip?>."></td> <!-- returned 3 dots -->
<td><input type="hidden" id="_mapfield" name="_mapfield" value="<?php echo $_streetaddress.''.$_zip;?>"></td> <!-- returned nothing -->
<td><input type="hidden" id="_mapfield" name="_mapfield" value="'<?php echo $_streetaddress . $_zip; ?>'"></td> <!-- returned one double quote -->
<td><input type="hidden" id="_mapfield" name="_mapfield" value= echo $_streetaddress . $_zip></td> <!-- returned the word echo -->
<td><input type="hidden" id="_mapfield" name="_mapfield" value= <?php echo $_streetaddress." ".$_zip; ?>></td> <!-- returned nothing-->
<td><input type="hidden" id="_mapfield" name="_mapfield" value= '<?php echo $_streetaddress." ".$_zip; ?>'></td> <!-- returned nothing -->
<td><input type="hidden" id="_mapfield" name="_mapfield" value= <?php $combined="$_streetaddress x $_zip"; ?>></td> <!-- returned nothing -->I am desperate. Anyone who has ANY recommendations about how to do this that works will earn my gratitude for life.