The database table output looks like thisSize:40Target Fish:Panfish, Gar, Trout, SaugerParking:YesLaunch Fees:YesKayak Cart Needed:YesCamping Available:YesDifficulty:EasyInfo:thisistheinformationprovidedinthisboxSubmitted By:markwatsonWebsite:httpwwwyakanglercom"> no spaces between words in a sentence. - Forums

Forums

no spaces between words in a sentence.

yaksushi 28 Aug, 2010
Ok after much trial and error I've gotten my form to somewhat work. I have a form that users can use to fill out a marker on phoca maps. The form works fine except in the description field under Info: and Submitted By: the words have no spaces... Any ideas? Also feel free to look over my code and tell me if I should change something, again I did this with Grey's help and alot of trial and error. It also removes the //. from my url

<div class="form_item">
  <div class="form_element cf_heading">
    <h1 class="cf_text">Fishing Location Form</h1>
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Location Name:</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_4" name="title" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">latitude :</label>
    <input class="cf_inputbox required" maxlength="150" size="30" title="" id="text_1" name="latitude" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">longitude :</label>
    <input class="cf_inputbox required" maxlength="150" size="30" title="" id="text_2" name="longitude" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_heading">
    <h3 class="cf_text">Site Attributes</h3>
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Acres:</label>
    <input class="cf_inputbox validate-number" maxlength="150" size="30" title="" id="text_14" name="text_14" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_checkbox">
    <label class="cf_label" style="width: 150px;">Target Fish:</label>
    <div class="float_left">
      <input value="Panfish" title="" class="radio validate-one-required" id="check00" name="check0[]" type="checkbox" />
      <label for="check00" class="check_label">Panfish</label>
      <br />
      
<input value="Bass" title="" class="radio validate-one-required" id="check01" name="check0[]" type="checkbox" />
      <label for="check01" class="check_label">Bass</label>
      <br />
      
<input value="Catfish" title="" class="radio validate-one-required" id="check02" name="check0[]" type="checkbox" />
      <label for="check02" class="check_label">Catfish</label>
      <br />
      
<input value="Gar" title="" class="radio validate-one-required" id="check03" name="check0[]" type="checkbox" />
      <label for="check03" class="check_label">Gar</label>
      <br />
      
<input value="Drum" title="" class="radio validate-one-required" id="check04" name="check0[]" type="checkbox" />
      <label for="check04" class="check_label">Drum</label>
      <br />
      
<input value="Trout" title="" class="radio validate-one-required" id="check05" name="check0[]" type="checkbox" />
      <label for="check05" class="check_label">Trout</label>
      <br />
      
<input value="Sauger" title="" class="radio validate-one-required" id="check06" name="check0[]" type="checkbox" />
      <label for="check06" class="check_label">Sauger</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Parking:</label>
    <select class="cf_inputbox validate-selection" id="select_16" size="1" title=""  name="select_16">
    <option value="">Choose Option</option>
      <option value="Yes">Yes</option>
<option value="No">No</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Launch/Ramp Fees:</label>
    <select class="cf_inputbox validate-selection" id="select_17" size="1" title=""  name="select_17">
    <option value="">Choose Option</option>
      <option value="Yes">Yes</option>
<option value="No">No</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Kayak cart needed:</label>
    <select class="cf_inputbox validate-selection" id="select_18" size="1" title=""  name="select_18">
    <option value="">Choose Option</option>
      <option value="Yes">Yes</option>
<option value="No">No</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Camping Available:</label>
    <select class="cf_inputbox validate-selection" id="select_19" size="1" title=""  name="select_19">
    <option value="">Choose Option</option>
      <option value="Yes">Yes</option>
<option value="No">No</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Difficulty:</label>
    <select class="cf_inputbox validate-selection" id="select_20" size="1" title=""  name="select_20">
    <option value="">Choose Option</option>
      <option value="Easy">Easy</option>
<option value="Moderate">Moderate</option>
<option value="Hard">Hard</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Info:</label>
    <input class="cf_inputbox required" maxlength="150" size="30" title="" id="text_18" name="text_18" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Submitted By:</label>
    <input class="cf_inputbox validate-alpha" maxlength="150" size="30" title="" id="text_19" name="text_19" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Website:</label>
    <input class="cf_inputbox validate-url" maxlength="150" size="30" title="" id="text_20" name="text_20" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<input value="1" id="hidden_5" name="displaygps" type="hidden" />

<input value="0" id="hidden_7" name="icon" type="hidden" />

<input value="0" id="hidden_6" name="markerwindow" type="hidden" />

<input value="0" id="hidden_9" name="published" type="hidden" />

<input value="1" id="hidden_8" name="catid" type="hidden" />

<div class="form_item">
  <div class="form_element cf_button">
    <input value="Submit Location" name="button_17" type="submit" />
  </div>
  <div class="cfclear"> </div>
</div>


<?php
$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::getWord('text_18', '', 'post');
$name =& JRequest::getWord('text_19', '', 'post');
$url =& JRequest::getWord('text_20', '', '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 />"."<strong>Website:</strong>".$url."<br />";
JRequest::setVar('description', $marker);
?>


The database table output looks like this

Size:40
Target Fish:Panfish, Gar, Trout, Sauger
Parking:Yes
Launch Fees:Yes
Kayak Cart Needed:Yes
Camping Available:Yes
Difficulty:Easy
Info:thisistheinformationprovidedinthisbox
Submitted By:markwatson
Website:httpwwwyakanglercom
GreyHead 28 Aug, 2010
Hi yaksushi,

I think the problem is with 'getWord()' in these lines
$info =& JRequest::getWord('text_18', '', 'post');
$name =& JRequest::getWord('text_19', '', 'post');

'getWord()' only allows [A-Za-z_] - hence no spaces. Try using getString() instead. The docs for the filters are here.

Bob
yaksushi 29 Aug, 2010
Thank you that was it!
This topic is locked and no more replies can be posted.