• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form Submission Breaking

#1
Information 
http://stackoverflow.com/questions/42962...1_42962041


Long story short, I inherited an application build on this platform and for the life of me I cannot figure out why this is not working.

I am building an additional form on the application using some of the same names associated with the `inputs` on other forms on the same page. (dynamically displayed via a drop down box)

Sample HTML:

   
Code:
<!-- ###################################### Envelope Form ####################################### -->
<div id="mainfull" class="form form5" style="display:none;">
<?php
$attributes = array('class' => '', 'id' => '_quotation_envelope');
echo form_open($form_action, $attributes);
?>
<div class="top">Envelope Print Order</div>

<div class="row">
<div class="radiobutton" style="display:none;"><input type="radio" name="type" value="Envelope" checked="checked"><label for="type">Type</label></div>

<p>Fill out the following form to order envelopes. Please ensure all information is accurate as this is what will appear on the envelope. Artwork is created on Fridays and typically takes 1 week to be printed and delivered there after.</p>


<!-- Department -->
<h1>Contact Info</h1>

<span class="question">Contact Name *</span>
<input class="required " type="text" name="fullname" maxlength="100" value="">
<br/>

<span class="question">Contact Phone *</span>
<input class="required " id="envelope-contact-phone" type="text" name="phone" maxlength="100" value="">
<br/>

<span class="question">Contact E-mail *</span>
<input class="required email " type="text" name="email" maxlength="100" value="">
<br/>
<span class="question">Contact Department:</span>
<input class=" " name="company" type="text" maxlength="100" value="">
<br/>

<span class="question">Account To Charge * (Fund - Dept. - Organization)</span>
<input id="envelope-accnt-to-charge" class="required " type="text" name="bacct" minlength="13" maxlength="13" value="">
<br/>


<hr>
<h1>Envelope Info</h1>

<span class="question">Quantity of Envelopes to Order</span>

<div class="radiobutton"><input type="radio" name="bcost" value="2500"><label>2,500</label></div>
<div class="radiobutton"><input type="radio" name="bcost" value="5000"><label>5,000</label></div>
<div class="radiobutton"><input type="radio" name="bcost" value="7500"><label>7,500</label></div>
<div class="radiobutton"><input type="radio" name="bcost" value="10000"><label>10,000</label></div>


<br/>
<span class="question">Department Name on Stationery * (Do not include the word "Department")<br/>&nbsp;&nbsp;&nbsp;<span style="color:red;">Example: Community Affairs Division - Human Resources</span></span>
<input class="required" id="dept_name" type="text" name="bdept" minlength="2" maxlength="55" value="" style="text-transform: capitalize;">
<br/>
<span class="question">Office Phone on Letterhead * </span>
<input id="envelope-phone-input" class="required phone-input" type="text" name="bphone"  value="">
<br/>
<span class="question">Address on Letterhead</span>
<p>All mail correspondence will be filtered through the city's main P.O. Box 2842, and routed to your department from our mail room. </p>

<div class="radiobutton"><input type="radio" name="baddress" value="1" checked="checked" /><label><?=$this->lang->line('quotation_question_bizaddress_1');?><?=$this->lang->line('quotation_question_bizaddress_CityStZip1');?></label></div>
<!--<div class="radiobutton"><input type="radio" name="baddress" value="2"><label><?=$this->lang->line('quotation_question_bizaddress_2');?><?=$this->lang->line('quotation_question_bizaddress_CityStZip2');?> (Finance/Accounts Payable)</label></div>
<div class="radiobutton"><input type="radio" name="baddress" value="3"><label><?=$this->lang->line('quotation_question_bizaddress_3');?><?=$this->lang->line('quotation_question_bizaddress_CityStZip3');?> (Billing &amp; Collections/Water Bills)</label></div> -->

<br/>


<span class="question">Additional Comments or special instructions</span>
<textarea name="comment" class="" rows="6" maxlength="400"></textarea>



<br>
<input type="checkbox" name="q3" required/>  I have verified the above information is correct and understand this is considered the final proof that will go directly to print. I understand that no additional proofing will be provided.
<br clear="all">
</div>
<div class="bottom">
<input type="submit" name="send" class="btn btn-success" value="Send Order"/>
</div>
<?php echo form_close(); ?>
</div>

<!-- ###################################### Envelope Form ####################################### -->



Form Processing:

   
PHP Code:
<!-- ######################################## ENVELOPE BACKEND ######################################## -->
                   <?php } elseif($quotation->type == 'Envelope'){ ?>
               <?php

               
$spc 
';';
$city 'City of St. Petersburg';
$textstring '';
$textstring .= ucwords (strtolower($quotation->bdept));
$textstring .= $spc;
$textstring .= $city;
$textstring .= $spc;
// $textstring .= strtoupper ($quotation->fullname);
// $textstring .= $spc;
// $textstring .= strtoupper ($quotation->phone);
// $textstring .= $spc;
// $textstring .= ucwords (strtolower($quotation->email));
// $textstring .= $spc;
// $textstring .= ucwords (strtolower($quotation->company));
// $textstring .= $spc;
$textstring .= $this->lang->line('quotation_question_bizaddress_'.$quotation->baddress);
$textstring .= $spc;
$textstring .= $this->lang->line('quotation_question_bizaddress_CityStZip'.$quotation->baddress);
$textstring .= $spc;
$textstring .= 'O: '.$quotation->bphone;
$textstring .= $spc;
echo 
'<input value="'.$textstring.'" style="width:100%;">';


//Create email link body
$emailbody '%0D%0A';
$emailbody '%0D%0A';
$emailbody .= '*** Department Letterhead Work Order Form *** %0D%0A';
$emailbody .= '%0D%0A';
$emailbody .= 'Charge Account: '$quotation->bacct .'-5320811 %0D%0A';
$emailbody .= 'Quantity Ordered: '$quotation->bcost .'%0D%0A';
// $emailbody .= 'Graphics Charges: $15' .'%0D%0A';
// $graphicsCharge = 15;
// $printshopSum = ($quotation->bcost * 0.1) - $graphicsCharge;
// $emailbody .= 'PrintShop Charges: $'. $printshopSum .'%0D%0A';
// $emailbody .= 'Total: $'. $quotation->bcost * 0.1 .'%0D%0A';
$emailbody .= 'Submitter: '$quotation->fullname .'%0D%0A';
$emailbody .= 'Submitter email: '$quotation->email .'%0D%0A';
$emailbody .= 'Submitter phone: '$quotation->phone .'%0D%0A';
$emailbody .= 'Original submit date: 'date('jS F Y H:i'$unix) .'%0D%0A';
$emailbody .= '%0D%0A';
$emailbody .= '*** Department Letterhead Data *** %0D%0A';
// $emailbody .= '%0D%0A';
// $emailbody .= 'First: '. $quotation->bname .'%0D%0A';
// $emailbody .= 'last: '. $quotation->blast .'%0D%0A';
// $emailbody .= 'Title: '. $quotation->btitle .'%0D%0A';
$emailbody .= 'Dept: '$quotation->bdept .'%0D%0A';
$emailbody .= 'Office: '$quotation->bphone .'%0D%0A';
// $emailbody .= 'Cell: '. $quotation->bcell .'%0D%0A';
// $emailbody .= 'Fax: '. $quotation->bfax .'%0D%0A';
$emailbody .= 'Address 1: '$this->lang->line('quotation_question_bizaddress_'.$quotation->baddress) .'%0D%0A';
$emailbody .= 'Address 2: '$this->lang->line('quotation_question_bizaddress_CityStZip'.$quotation->baddress) .'%0D%0A';
// $emailbody .= 'email: '. $quotation->bemail .'%0D%0A';

// $emailbody = str_replace('&amp;', '%26', $emailbody);



?><br>

               <a class="btn" HREF="mailto:email@email.com?subject=Department Letterhead Work Order - <?=$quotation->bname.' '.$quotation->blast?>&body=<?=$emailbody?>">Create Email for Printshop</a>
               <a class="btn" HREF="mailto:<?=$quotation->bemail?>?subject=Department Letterhead Work Order - <?=$quotation->bname.' '.$quotation->blast?>&body=<?=$emailbody?>">Create Email for Submitter</a>

               <br><br>

                   <ul class="details">
                       <li><span class="question">Charge Account: </span> <?=$quotation->bacct;?></li>
                       <li><span class="question">Quantity: </span> <?=$quotation->bcost;?></li>
                       <li><span class="question">Office Phone</span> <?=$quotation->bphone;?></li>
                       <li><span class="question">Address 1</span> <?=$this->lang->line('quotation_question_bizaddress_'.$quotation->baddress);?></li>
                       <li><span class="question">Address 2</span> <?=$this->lang->line('quotation_question_bizaddress_CityStZip'.$quotation->baddress);?></li>
                       <li><span class="question">Comments</span> <?=$quotation->comment;?></li>
                   </ul>

<!-- ######################################## ENVELOPE BACKEND ######################################## --> 


Of course these are jsut snippets, but I am hoping they're enough to give you an idea. When submitted how they appear, the form and submission works perfect. However, when changing `bcost` on both the front and back end, the submission breaks and nothing is processed.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.