It's saving some stuff in the the DB but nothing that is called in the php code above... Any ideas?"> Issues with my php code being processed? - Forums

Forums

Issues with my php code being processed?

yaksushi 09 May, 2012
I don't think my form is processing my custom php code.

Here is my HTML code:
<link type="text/css" href="css/main.css" rel="stylesheet" />
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="/map/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/map/js/jquery-ui-1.8.1.custom.min.js"></script>
    <script type="text/javascript" src="/map/js/main.js"></script><div class="ccms_form_element cfdiv_header" id="autoID-4db392768110d4604c6424cc459a7a08_container_div"><h3>Fishing Locations Submission Form</h3><div class="clear"></div></div><div class="ccms_form_element cfdiv_text" id="location_container_div"><label for="location">Location Name: *</label><input id="location" maxlength="50" size="30" class=" validate['required']" title="" type="text" value="" name="location" />
<div class="clear"></div><div id="error-message-location"></div></div><div class="ccms_form_element cfdiv_select" id="type_container_div"><label for="type">Location Type: *</label><select size="1" id="type" class=" validate['required']" title="" name="type">
<option value="">Please select</option>
<option value="River">River</option>
<option value="Pond">Pond</option>
<option value="Lake">Lake</option>
<option value="Bay">Bay</option>
<option value="Marsh">Marsh</option>
<option value="Flats">Flats</option>
<option value="Ocean">Ocean</option>
<option value="" selected="selected"></option>
</select>
<div class="clear"></div><div id="error-message-type"></div></div><div class="ccms_form_element cfdiv_header" id="autoID-d5193d6ef4b962b13ea8981000c23788_container_div"><h4>Adding a new launch sites is just a few simple clicks!</h4>
<p>
   1. Search for your location in the field below.
<br>
   2. A red marker will appear, move marker as needed.
<br>
   3. Complete the rest of the locations form.
</p><div class="clear"></div></div><html>
  <head>
    <title>Geocoding with GMap v3</title>
  </head>
  <body>
    <label>Address: </label><input id="address"  type="text"/>
    <div id="map_canvas" style="width:670px; height:430px"></div><br/>
  </body>
</html><input id="longitude" type="hidden" value="" name="longitude " />
<input id="latitude" type="hidden" value="" name="latitude " />
<div class="ccms_form_element cfdiv_checkboxgroup" id="fresh_container_div"><label for="fresh">Freshwater Species: </label><input type="hidden" name="fresh" value="" alt="ghost" />
<div style="float:left; clear:none;"><input type="checkbox" name="fresh[]" id="fresh_0" title="" value="Bass L Mouth" class="" />
<label for="fresh_0">Bass L Mouth</label>
<input type="checkbox" name="fresh[]" id="fresh_1" title="" value="Bass Peacock" class="" />
<label for="fresh_1">Bass Peacock</label>
<input type="checkbox" name="fresh[]" id="fresh_2" title="" value="Bass S Mouth" class="" />
<label for="fresh_2">Bass S Mouth</label>
<input type="checkbox" name="fresh[]" id="fresh_3" title="" value="Carp" class="" />
<label for="fresh_3">Carp</label>
<input type="checkbox" name="fresh[]" id="fresh_4" title="" value="Catfish" class="" />
<label for="fresh_4">Catfish</label>
<input type="checkbox" name="fresh[]" id="fresh_5" title="" value="Drum" class="" />
<label for="fresh_5">Drum</label>
<input type="checkbox" name="fresh[]" id="fresh_6" title="" value="Gar" class="" />
<label for="fresh_6">Gar</label>
<input type="checkbox" name="fresh[]" id="fresh_7" title="" value="Musky" class="" />
<label for="fresh_7">Musky</label>
<input type="checkbox" name="fresh[]" id="fresh_8" title="" value="Panfish" class="" />
<label for="fresh_8">Panfish</label>
<input type="checkbox" name="fresh[]" id="fresh_9" title="" value="Perch" class="" />
<label for="fresh_9">Perch</label>
<input type="checkbox" name="fresh[]" id="fresh_10" title="" value="Pike" class="" />
<label for="fresh_10">Pike</label>
<input type="checkbox" name="fresh[]" id="fresh_11" title="" value="Salmon" class="" />
<label for="fresh_11">Salmon</label>
<input type="checkbox" name="fresh[]" id="fresh_12" title="" value="Sauger" class="" />
<label for="fresh_12">Sauger</label>
<input type="checkbox" name="fresh[]" id="fresh_13" title="" value="Spoonbill" class="" />
<label for="fresh_13">Spoonbill</label>
<input type="checkbox" name="fresh[]" id="fresh_14" title="" value="Striper" class="" />
<label for="fresh_14">Striper</label>
<input type="checkbox" name="fresh[]" id="fresh_15" title="" value="Trout" class="" />
<label for="fresh_15">Trout</label>
<input type="checkbox" name="fresh[]" id="fresh_16" title="" value="Walleye" class="" />
<label for="fresh_16">Walleye</label>
<input type="checkbox" name="fresh[]" id="fresh_17" title="" value="Other" class="" />
<label for="fresh_17">Other</label>
</div><div class="clear"></div><div id="error-message-fresh"></div></div><div class="ccms_form_element cfdiv_checkboxgroup" id="salt_container_div"><label for="salt">Saltwater Species: </label><input type="hidden" name="salt" value="" alt="ghost" />
<div style="float:left; clear:none;"><input type="checkbox" name="salt[]" id="salt_0" title="" value="Billfish" class="" />
<label for="salt_0">Billfish</label>
<input type="checkbox" name="salt[]" id="salt_1" title="" value="Bonefish" class="" />
<label for="salt_1">Bonefish</label>
<input type="checkbox" name="salt[]" id="salt_2" title="" value="Cod" class="" />
<label for="salt_2">Cod</label>
<input type="checkbox" name="salt[]" id="salt_3" title="" value="Crab" class="" />
<label for="salt_3">Crab</label>
<input type="checkbox" name="salt[]" id="salt_4" title="" value="Drum" class="" />
<label for="salt_4">Drum</label>
<input type="checkbox" name="salt[]" id="salt_5" title="" value="Flounder" class="" />
<label for="salt_5">Flounder</label>
<input type="checkbox" name="salt[]" id="salt_6" title="" value="Grouper" class="" />
<label for="salt_6">Grouper</label>
<input type="checkbox" name="salt[]" id="salt_7" title="" value="Halibut" class="" />
<label for="salt_7">Halibut</label>
<input type="checkbox" name="salt[]" id="salt_8" title="" value="Ling Cod" class="" />
<label for="salt_8">Ling Cod</label>
<input type="checkbox" name="salt[]" id="salt_9" title="" value="Mahi-Mahi" class="" />
<label for="salt_9">Mahi-Mahi</label>
<input type="checkbox" name="salt[]" id="salt_10" title="" value="Redfish" class="" />
<label for="salt_10">Redfish</label>
<input type="checkbox" name="salt[]" id="salt_11" title="" value="Rockfish" class="" />
<label for="salt_11">Rockfish</label>
<input type="checkbox" name="salt[]" id="salt_12" title="" value="Salmon" class="" />
<label for="salt_12">Salmon</label>
<input type="checkbox" name="salt[]" id="salt_13" title="" value="Sea Bass" class="" />
<label for="salt_13">Sea Bass</label>
<input type="checkbox" name="salt[]" id="salt_14" title="" value="Shark" class="" />
<label for="salt_14">Shark</label>
<input type="checkbox" name="salt[]" id="salt_15" title="" value="Snook" class="" />
<label for="salt_15">Snook</label>
<input type="checkbox" name="salt[]" id="salt_16" title="" value="Striper" class="" />
<label for="salt_16">Striper</label>
<input type="checkbox" name="salt[]" id="salt_17" title="" value="Sturgeon" class="" />
<label for="salt_17">Sturgeon</label>
<input type="checkbox" name="salt[]" id="salt_18" title="" value="Tarpon" class="" />
<label for="salt_18">Tarpon</label>
<input type="checkbox" name="salt[]" id="salt_19" title="" value="Trout" class="" />
<label for="salt_19">Trout</label>
<input type="checkbox" name="salt[]" id="salt_20" title="" value="Tuna" class="" />
<label for="salt_20">Tuna</label>
<input type="checkbox" name="salt[]" id="salt_21" title="" value="Yellowtail" class="" />
<label for="salt_21">Yellowtail</label>
<input type="checkbox" name="salt[]" id="salt_22" title="" value="Other" class="" />
<label for="salt_22">Other</label>
</div><div class="clear"></div><div id="error-message-salt"></div></div><div class="ccms_form_element cfdiv_header" id="autoID-c4dc27ec81ace4b4ff4cba02fa9f1a97_container_div"><div class="clear"></div></div><div class="ccms_form_element cfdiv_text" id="acres_container_div"><label for="acres">Acres: </label><input id="acres" maxlength="20" size="30" class=" validate['required','number']" title="" type="text" value="" name="acres" />
<div class="clear"></div><div id="error-message-acres"></div></div><div class="ccms_form_element cfdiv_select" id="parking_container_div"><label for="parking">Parking: *</label><select size="1" id="parking" class="" title="" name="parking">
<option value="">Please select</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
<div class="clear"></div><div id="error-message-parking"></div></div><div class="ccms_form_element cfdiv_select" id="fees_container_div"><label for="fees">Launch Fees: *</label><select size="1" id="fees" class="" title="" name="fees">
<option value="">Please select</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
<div class="clear"></div><div id="error-message-fees"></div></div><div class="ccms_form_element cfdiv_select" id="kart_container_div"><label for="kart">Kart Needed: *</label><select size="1" id="kart" class="" title="" name="kart">
<option value="">Please select</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
<div class="clear"></div><div id="error-message-kart"></div></div><div class="ccms_form_element cfdiv_select" id="difficulty_container_div"><label for="difficulty ">Difficulty: *</label><select size="1" id="difficulty " class=" validate['required']" title="" name="difficulty ">
<option value="">Please select</option>
<option value="Easy">Easy</option>
<option value="Moderate">Moderate</option>
<option value="Hard">Hard</option>
</select>
<div class="clear"></div><div id="error-message-difficulty "></div></div><div class="ccms_form_element cfdiv_textarea" id="info_container_div"><label for="info">Info : *</label><textarea id="info" cols="45" rows="12" class=" validate['required']" title="" name="info"></textarea>
<div class="clear"></div><div id="error-message-info"></div></div><div class="ccms_form_element cfdiv_text" id="name_container_div"><label for="name">Submitted by:</label><input id="name" maxlength="150" size="30" class="" title="" type="text" value="" name="name" />
<div class="clear"></div><div id="error-message-name"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-b7c6797ca98aa7a62db2470358423838_container_div"><label>Email: </label><input maxlength="150" size="30" class=" validate['required','email']" title="" type="text" value="" name="email" />
<div class="clear"></div><div id="error-message-email"></div></div><input id="username" type="hidden" value="" name="username" />

<input value="{mos" id="hidden_1" name="hidden_1" type="hidden" />
<input value="map width='400'|height='300'|lat='" id="hidden_2" name="hidden_2" type="hidden" />
<input value="'|lon='" id="hidden_3" name="hidden_3" type="hidden" />
<input value="'|zoom='12'|mapType='Satellite'|overview='0'|marker='0'|align='left'|Overview='1'}" id="hidden_4" name="hidden_4" type="hidden" />
<input value="'| align='left'|address='street, zipcode place, country'|dir='1'}" id="hidden_5" name="hidden_5" type="hidden" />
<input value="0" id="hidden_6" name="displaygps" type="hidden" />
<input value="0" id="hidden_7" name="icon" type="hidden" />
<input value="0" id="hidden_8" name="markerwindow" type="hidden" />
<input value="79" id="hidden_9" name="catid" type="hidden" />
<input value="0" id="hidden_10" name="published" type="hidden" />
<input value="518" id="hidden_11" name="created_by" type="hidden" />
<input type='hidden' name='created' value='<?php echo date('Y-m-d H:i:s'); ?>' />


<div class="ccms_form_element cfdiv_submit" id="autoID-6075aadd768c75a790c65dc51c59e454_container_div"><input name="input_submit_17" class="" value="Submit" type="submit" />
<div class="clear"></div><div id="error-message-input_submit_17"></div></div>


Here are how my events are set up: http://awesomescreenshot.com/03e59hud8

Here is my php code in the custom code box: http://awesomescreenshot.com/09359hv06

<?php
$hidden_1 = JRequest::getString('hidden_1', '', 'post');
$hidden_2 = JRequest::getString('hidden_2', '', 'post');
$hidden_3 = JRequest::getString('hidden_3', '', 'post');
$hidden_4 = JRequest::getString('hidden_4', '', 'post');
$hidden_5 = JRequest::getString('hidden_5', '', 'post');
$hidden_11 = JRequest::getString('hidden_11', '', 'post');
$latitude = JRequest::getString('latitude', '', 'post');
$longitude = JRequest::getString('longitude', '', 'post');
$location =& JRequest::getString('select_21','post');
$size =& JRequest::getInt('text_14', '', 'post');
$fish =& JRequest::getVar('check0', 'post');
$parking =& JRequest::getString('select_16','post');
$launch =& JRequest::getString('select_17','post');
$cart =& JRequest::getString('select_18','post');
$camp =& JRequest::getString('select_19','post');
$difficulty =& JRequest::getString('select_20','post');
$info =& JRequest::getString('text_18', '', 'post');
$name =& JRequest::getString('username', '', 'post');
$marker = "<strong>Size:</strong>".$size."<br />"."<strong>Target Fish: </strong>".$fish."<br />"."<strong>Parking: </strong>".$parking."<br />"."<strong>Launch Fees: </strong>".$launch."<br />"."<strong>Kayak Cart Needed: </strong>".$cart."<br />"."<strong>Camping Available: </strong>".$camp."<br />"."<strong>Difficulty: </strong>".$difficulty."<br />"."<strong>Info: </strong>".$info."<br />"."<strong>Submitted By: </strong>".$name."<br />"."<br />"."<br />"."<br />"."<strong>Satellite View: </strong>".$hidden_1.$hidden_2.$latitude.$hidden_3.$longitude.$hidden_4."<br />"."<br />"."<br />"."<strong>Street View: </strong>".$hidden_1.$hidden_2.$latitude.$hidden_3.$longitude.$hidden_5."<br />";
$marker1 = "<strong>Location: </strong>".$location."<br />"."<strong>Latitude: </strong>".$latitude."<br />"."<strong>Longitude: </strong>".$longitude."<br />"."<br />"."<br />";
$marker3 = "<strong>Location: </strong>".$location."<br />"."<strong>Latitude: </strong>".$latitude."<br />"."<strong>Longitude: </strong>".$longitude."<br />"."<br />"."<strong>{See More Details}</strong>"."<br />";
JRequest::setVar('description', $marker3);
JRequest::setVar('fulltext', $marker);
JRequest::setVar('introtext', $marker1);
?>


It's saving some stuff in the the DB but nothing that is called in the php code above... Any ideas?
Max_admin 10 May, 2012
So your data is not saved in the database or there is something else ?
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
yaksushi 10 May, 2012
The data that should be getting placed in the DB from my php code is not getting in there. Other elements from the form that are not in the php code are being added to the DB.
GreyHead 13 May, 2012
Hi yaksushi,

For your data to be saved by the DB Save action it must be in the $form->data array. So this line (for example)
$marker1 = "<strong>Location: </strong>".$location."<br />"."<strong>Latitude: </strong>".$latitude."<br />"."<strong>Longitude: </strong>".$longitude."<br />"."<br />"."<br />";
needs to be
$form->data['marker1'] = "<strong>Location: </strong>".$location."<br />"."<strong>Latitude: </strong>".$latitude."<br />"."<strong>Longitude: </strong>".$longitude."<br />"."<br />"."<br />";
assuming that the name of the column in the database table is 'marker1'.

Bob

PS You can simplify the code a bit more too:
$form->data['marker1'] = "<strong>Location: </strong>{$location}<br /><strong>Latitude: </strong>{$latitude}<br /><strong>Longitude: </strong>{$longitude}<br /><br /><br />";
yaksushi 16 May, 2012
Bob thanks for your reply. I tried using your example but the form just doesn't want to process the php...

<?php
$hidden_1 = JRequest::getString('hidden_1', '', 'post');
$hidden_2 = JRequest::getString('hidden_2', '', 'post');
$hidden_3 = JRequest::getString('hidden_3', '', 'post');
$hidden_4 = JRequest::getString('hidden_4', '', 'post');
$hidden_5 = JRequest::getString('hidden_5', '', 'post');
$hidden_11 = JRequest::getString('hidden_11', '', 'post');
$latitude = JRequest::getString('latitude', '', 'post');
$longitude = JRequest::getString('longitude', '', 'post');
$location =& JRequest::getString('select_21','post');
$size =& JRequest::getInt('text_14', '', 'post');
$fish =& JRequest::getVar('check0', 'post');
$parking =& JRequest::getString('select_16','post');
$launch =& JRequest::getString('select_17','post');
$cart =& JRequest::getString('select_18','post');
$camp =& JRequest::getString('select_19','post');
$difficulty =& JRequest::getString('select_20','post');
$info =& JRequest::getString('text_18', '', 'post');
$name =& JRequest::getString('username', '', 'post');
$form->data['marker'] = "<strong>Size: </strong>{$size}<br /><strong>Target Fish: </strong>{$fish}<br /><strong>Parking: </strong>{$parking}<br /><strong>Launch Fees: </strong>{$launch}<br /><strong>Kayak Cart Needed: </strong>{$cart}<br /><strong>Camping Available: </strong>{$camp}<br /><strong>Difficulty: </strong>{$difficulty}<br /><strong>Info: </strong>{$info}<br /><strong>Submitted By: </strong>{$name}<br /><br /><br /><br /><strong>Satellite View: </strong>".$hidden_1.$hidden_2.$latitude.$hidden_3.$longitude.$hidden_4."<br /><br /><br /><strong>Street View: </strong>".$hidden_1.$hidden_2.$latitude.$hidden_3.$longitude.$hidden_5."<br />";
$form->data['marker1'] = "<strong>Location: </strong>{$location}<br /><strong>Latitude: </strong>{$latitude}<br /><strong>Longitude: </strong>{$longitude}<br /><br /><br />";
$form->data['marker3'] = "<strong>Location: </strong>{$location}<br /><strong>Latitude: </strong>{$latitude}<br /><strong>Longitude: </strong>{$longitude}<br /><br /><strong>{See More Details}</strong><br />";
JRequest::setVar('description', $marker3);
JRequest::setVar('fulltext', $marker);
JRequest::setVar('introtext', $marker1);
?>
GreyHead 17 May, 2012
Hi yaksushi,

Just confirming, this is ChronoForms v4 that you are using?

What is this code supposed to do and what exactly isn't being processed?

Bob
yaksushi 17 May, 2012
Thanks for your help Bob! Yes this is Chronoforms v4

My form has several elements that need to be combined. I'm trying to do what I did in an older version of Chonoforms. Here is a link to my old Chronoforms code http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=67358

Here is my new form code for my Joomla 2.5 Chronoforms v4 form:
<link type="text/css" href="css/main.css" rel="stylesheet" />
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="/map/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/map/js/jquery-ui-1.8.1.custom.min.js"></script>
    <script type="text/javascript" src="/map/js/main.js"></script><div class="ccms_form_element cfdiv_header" id="autoID-a9ecdaee9656f1b747a1556fd519d8f9_container_div"><h3>Fishing Locations Submission Form</h3><div class="clear"></div></div><div class="ccms_form_element cfdiv_text" id="location_container_div"><label for="location">Location Name: *</label><input id="location" maxlength="50" size="30" class=" validate['required']" title="" type="text" value="" name="location" />
<div class="clear"></div><div id="error-message-location"></div></div><div class="ccms_form_element cfdiv_select" id="type_container_div"><label for="type">Location Type: *</label><select size="1" id="type" class=" validate['required']" title="" name="type">
<option value="">Please select</option>
<option value="River">River</option>
<option value="Pond">Pond</option>
<option value="Lake">Lake</option>
<option value="Bay">Bay</option>
<option value="Marsh">Marsh</option>
<option value="Flats">Flats</option>
<option value="Ocean">Ocean</option>
<option value="" selected="selected"></option>
</select>
<div class="clear"></div><div id="error-message-type"></div></div><div class="ccms_form_element cfdiv_header" id="autoID-5f3e1b383b961b7a5383a30fad8aaa0a_container_div"><h4>Adding a new launch sites is just a few simple clicks!</h4>
<p>
   1. Search for your location in the field below.
<br>
   2. A red marker will appear, move marker as needed.
<br>
   3. Complete the rest of the locations form.
</p><div class="clear"></div></div><html>
  <head>
    <title>Geocoding with GMap v3</title>
  </head>
  <body>
    <label>Address: </label><input id="address"  type="text"/>
    <div id="map_canvas" style="width:670px; height:430px"></div><br/>
  </body>
</html><input id="longitude" type="hidden" value="" name="longitude " />
<input id="latitude" type="hidden" value="" name="latitude " />
<div class="ccms_form_element cfdiv_checkboxgroup" id="fresh_container_div"><label for="fresh">Freshwater Species: </label><input type="hidden" name="fresh" value="" alt="ghost" />
<div style="float:left; clear:none;"><input type="checkbox" name="fresh[]" id="fresh_0" title="" value="Bass L Mouth" class="" />
<label for="fresh_0">Bass L Mouth</label>
<input type="checkbox" name="fresh[]" id="fresh_1" title="" value="Bass Peacock" class="" />
<label for="fresh_1">Bass Peacock</label>
<input type="checkbox" name="fresh[]" id="fresh_2" title="" value="Bass S Mouth" class="" />
<label for="fresh_2">Bass S Mouth</label>
<input type="checkbox" name="fresh[]" id="fresh_3" title="" value="Carp" class="" />
<label for="fresh_3">Carp</label>
<input type="checkbox" name="fresh[]" id="fresh_4" title="" value="Catfish" class="" />
<label for="fresh_4">Catfish</label>
<input type="checkbox" name="fresh[]" id="fresh_5" title="" value="Drum" class="" />
<label for="fresh_5">Drum</label>
<input type="checkbox" name="fresh[]" id="fresh_6" title="" value="Gar" class="" />
<label for="fresh_6">Gar</label>
<input type="checkbox" name="fresh[]" id="fresh_7" title="" value="Musky" class="" />
<label for="fresh_7">Musky</label>
<input type="checkbox" name="fresh[]" id="fresh_8" title="" value="Panfish" class="" />
<label for="fresh_8">Panfish</label>
<input type="checkbox" name="fresh[]" id="fresh_9" title="" value="Perch" class="" />
<label for="fresh_9">Perch</label>
<input type="checkbox" name="fresh[]" id="fresh_10" title="" value="Pike" class="" />
<label for="fresh_10">Pike</label>
<input type="checkbox" name="fresh[]" id="fresh_11" title="" value="Salmon" class="" />
<label for="fresh_11">Salmon</label>
<input type="checkbox" name="fresh[]" id="fresh_12" title="" value="Sauger" class="" />
<label for="fresh_12">Sauger</label>
<input type="checkbox" name="fresh[]" id="fresh_13" title="" value="Spoonbill" class="" />
<label for="fresh_13">Spoonbill</label>
<input type="checkbox" name="fresh[]" id="fresh_14" title="" value="Striper" class="" />
<label for="fresh_14">Striper</label>
<input type="checkbox" name="fresh[]" id="fresh_15" title="" value="Trout" class="" />
<label for="fresh_15">Trout</label>
<input type="checkbox" name="fresh[]" id="fresh_16" title="" value="Walleye" class="" />
<label for="fresh_16">Walleye</label>
<input type="checkbox" name="fresh[]" id="fresh_17" title="" value="Other" class="" />
<label for="fresh_17">Other</label>
</div><div class="clear"></div><div id="error-message-fresh"></div></div><div class="ccms_form_element cfdiv_checkboxgroup" id="salt_container_div"><label for="salt">Saltwater Species: </label><input type="hidden" name="salt" value="" alt="ghost" />
<div style="float:left; clear:none;"><input type="checkbox" name="salt[]" id="salt_0" title="" value="Billfish" class="" />
<label for="salt_0">Billfish</label>
<input type="checkbox" name="salt[]" id="salt_1" title="" value="Bonefish" class="" />
<label for="salt_1">Bonefish</label>
<input type="checkbox" name="salt[]" id="salt_2" title="" value="Cod" class="" />
<label for="salt_2">Cod</label>
<input type="checkbox" name="salt[]" id="salt_3" title="" value="Crab" class="" />
<label for="salt_3">Crab</label>
<input type="checkbox" name="salt[]" id="salt_4" title="" value="Drum" class="" />
<label for="salt_4">Drum</label>
<input type="checkbox" name="salt[]" id="salt_5" title="" value="Flounder" class="" />
<label for="salt_5">Flounder</label>
<input type="checkbox" name="salt[]" id="salt_6" title="" value="Grouper" class="" />
<label for="salt_6">Grouper</label>
<input type="checkbox" name="salt[]" id="salt_7" title="" value="Halibut" class="" />
<label for="salt_7">Halibut</label>
<input type="checkbox" name="salt[]" id="salt_8" title="" value="Ling Cod" class="" />
<label for="salt_8">Ling Cod</label>
<input type="checkbox" name="salt[]" id="salt_9" title="" value="Mahi-Mahi" class="" />
<label for="salt_9">Mahi-Mahi</label>
<input type="checkbox" name="salt[]" id="salt_10" title="" value="Redfish" class="" />
<label for="salt_10">Redfish</label>
<input type="checkbox" name="salt[]" id="salt_11" title="" value="Rockfish" class="" />
<label for="salt_11">Rockfish</label>
<input type="checkbox" name="salt[]" id="salt_12" title="" value="Salmon" class="" />
<label for="salt_12">Salmon</label>
<input type="checkbox" name="salt[]" id="salt_13" title="" value="Sea Bass" class="" />
<label for="salt_13">Sea Bass</label>
<input type="checkbox" name="salt[]" id="salt_14" title="" value="Shark" class="" />
<label for="salt_14">Shark</label>
<input type="checkbox" name="salt[]" id="salt_15" title="" value="Snook" class="" />
<label for="salt_15">Snook</label>
<input type="checkbox" name="salt[]" id="salt_16" title="" value="Striper" class="" />
<label for="salt_16">Striper</label>
<input type="checkbox" name="salt[]" id="salt_17" title="" value="Sturgeon" class="" />
<label for="salt_17">Sturgeon</label>
<input type="checkbox" name="salt[]" id="salt_18" title="" value="Tarpon" class="" />
<label for="salt_18">Tarpon</label>
<input type="checkbox" name="salt[]" id="salt_19" title="" value="Trout" class="" />
<label for="salt_19">Trout</label>
<input type="checkbox" name="salt[]" id="salt_20" title="" value="Tuna" class="" />
<label for="salt_20">Tuna</label>
<input type="checkbox" name="salt[]" id="salt_21" title="" value="Yellowtail" class="" />
<label for="salt_21">Yellowtail</label>
<input type="checkbox" name="salt[]" id="salt_22" title="" value="Other" class="" />
<label for="salt_22">Other</label>
</div><div class="clear"></div><div id="error-message-salt"></div></div><div class="ccms_form_element cfdiv_header" id="autoID-0431721f4049460866810cf81ca83123_container_div"><div class="clear"></div></div><div class="ccms_form_element cfdiv_text" id="acres_container_div"><label for="acres">Acres: </label><input id="acres" maxlength="20" size="30" class=" validate['required','number']" title="" type="text" value="" name="acres" />
<div class="clear"></div><div id="error-message-acres"></div></div><div class="ccms_form_element cfdiv_select" id="parking_container_div"><label for="parking">Parking: *</label><select size="1" id="parking" class="" title="" name="parking">
<option value="">Please select</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
<div class="clear"></div><div id="error-message-parking"></div></div><div class="ccms_form_element cfdiv_select" id="fees_container_div"><label for="fees">Launch Fees: *</label><select size="1" id="fees" class="" title="" name="fees">
<option value="">Please select</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
<div class="clear"></div><div id="error-message-fees"></div></div><div class="ccms_form_element cfdiv_select" id="kart_container_div"><label for="kart">Kart Needed: *</label><select size="1" id="kart" class="" title="" name="kart">
<option value="">Please select</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
<div class="clear"></div><div id="error-message-kart"></div></div><div class="ccms_form_element cfdiv_select" id="difficulty_container_div"><label for="difficulty ">Difficulty: *</label><select size="1" id="difficulty " class=" validate['required']" title="" name="difficulty ">
<option value="">Please select</option>
<option value="Easy">Easy</option>
<option value="Moderate">Moderate</option>
<option value="Hard">Hard</option>
</select>
<div class="clear"></div><div id="error-message-difficulty "></div></div><div class="ccms_form_element cfdiv_textarea" id="info_container_div"><label for="info">Info : *</label><textarea id="info" cols="45" rows="12" class=" validate['required']" title="" name="info"></textarea>
<div class="clear"></div><div id="error-message-info"></div></div><div class="ccms_form_element cfdiv_text" id="name_container_div"><label for="name">Submitted by:</label><input id="name" maxlength="150" size="30" class="" title="" type="text" value="" name="name" />
<div class="clear"></div><div id="error-message-name"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-c73aca80a1c1c63082d92147fdc782d8_container_div"><label>Email: </label><input maxlength="150" size="30" class=" validate['required','email']" title="" type="text" value="" name="email" />
<div class="clear"></div><div id="error-message-email"></div></div><input id="username" type="hidden" value="" name="username" />
<div class="ccms_form_element cfdiv_submit" id="autoID-d6fedc5acfb2aab020304399a5fef90c_container_div"><input name="input_submit_17" class="" value="Submit" type="submit" />
<div class="clear"></div><div id="error-message-input_submit_17"></div></div>


Here is my code that is a custom code box: http://awesomescreenshot.com/08f5uzo52

<?php
$hidden_1 = JRequest::getString('hidden_1', '', 'post');
$hidden_2 = JRequest::getString('hidden_2', '', 'post');
$hidden_3 = JRequest::getString('hidden_3', '', 'post');
$hidden_4 = JRequest::getString('hidden_4', '', 'post');
$hidden_5 = JRequest::getString('hidden_5', '', 'post');
$hidden_11 = JRequest::getString('hidden_11', '', 'post');
$latitude = JRequest::getString('latitude', '', 'post');
$longitude = JRequest::getString('longitude', '', 'post');
$location =& JRequest::getString('select_21','post');
$size =& JRequest::getInt('text_14', '', 'post');
$fish =& JRequest::getVar('check0', 'post');
$parking =& JRequest::getString('select_16','post');
$launch =& JRequest::getString('select_17','post');
$cart =& JRequest::getString('select_18','post');
$camp =& JRequest::getString('select_19','post');
$difficulty =& JRequest::getString('select_20','post');
$info =& JRequest::getString('text_18', '', 'post');
$name =& JRequest::getString('username', '', 'post');
$form->data['marker'] = "<strong>Size: </strong>{$size}<br /><strong>Target Fish: </strong>{$fish}<br /><strong>Parking: </strong>{$parking}<br /><strong>Launch Fees: </strong>{$launch}<br /><strong>Kayak Cart Needed: </strong>{$cart}<br /><strong>Camping Available: </strong>{$camp}<br /><strong>Difficulty: </strong>{$difficulty}<br /><strong>Info: </strong>{$info}<br /><strong>Submitted By: </strong>{$name}<br /><br /><br /><br /><strong>Satellite View: </strong>".$hidden_1.$hidden_2.$latitude.$hidden_3.$longitude.$hidden_4."<br /><br /><br /><strong>Street View: </strong>".$hidden_1.$hidden_2.$latitude.$hidden_3.$longitude.$hidden_5."<br />";
$form->data['marker1'] = "<strong>Location: </strong>{$location}<br /><strong>Latitude: </strong>{$latitude}<br /><strong>Longitude: </strong>{$longitude}<br /><br /><br />";
$form->data['marker3'] = "<strong>Location: </strong>{$location}<br /><strong>Latitude: </strong>{$latitude}<br /><strong>Longitude: </strong>{$longitude}<br /><br /><strong>{See More Details}</strong><br />";
JRequest::setVar('description', $marker3);
JRequest::setVar('fulltext', $marker);
JRequest::setVar('introtext', $marker1);
?>


The php code in the custom box is not processing.
GreyHead 19 May, 2012
Hi yaksushi,

I'd guess that the code is being processed but isn't doing what you want it to.

ChronoForms v4 only reads the $_REQUEST array once when the form is first submitted (or loaded). it copies the data into the $form->data array and all the remaining processing uses that. So these lines
JRequest::setVar('description', $marker3);
JRequest::setVar('fulltext', $marker);
JRequest::setVar('introtext', $marker1);
and any others like them will be processed but not is a way that makes the data accessible to ChronoForms. Instead you need:
$form->data['description'] = $marker3;
$form->data['fulltext'] = $marker;
$form->data['introtext'] = $marker1;

Bob
This topic is locked and no more replies can be posted.