0

I have a page with mixed sources of content. The top half of it is hard coded html with values echo'd from a db like so:

Part Number: <input type="text" name="pn" size="25" id="1" value="<?php    
echo "$STH->pn"; ?>"/>
Part Nomenclature: <input type="text" id="partnomen" name="part_nomenclature" 
size="35" value="<?php echo "$STH->part_nomenclature"; ?>"/>
Quantity:<input type="text" name="qty" size="3" value="<?php echo "$STH->qty";  
?>"/><br />
Serial Number <input type="text" name="sn" size="25" value="<?php echo "$STH->sn"; 
?>"/>
ATA Code: <input type="text" name="ata" size="12" value="<?php echo "$STH->ata"; ?>"/>
Control Order: xxxxxx&nbsp;&nbsp;
Engine Model: xxxxxxxx<br />
Engine Serial Number: xxxxxxxx&nbsp;&nbsp;
Removed From A/C Serial# <input type="text" name="acsn" value="<?php echo
"$STH->acsn"; ?>"/>
TT / TC: ___________________-->
<input type="hidden" name="db_date" value="<?php echo "$STH->db_date"; ?>"/>
<h3 id="addinfo">Reason For Workorder: </h3>

The middle contains html and values that are both echo'd onto the page:

echo "

<div id='addlinfo'>
<input type='hidden' name='wo_id' value='$wo_id'/>
Sequence<input type='text' name='sel_id[]' size='1' value='$i'/>
Repair ID:<input type='text' name='repair_id[]' size='1' 
value='$STH->repair_id'readonly/>
Part Nomenclature: <input type='text' name='' size='35' 
value='$STH->part_nomenclature'readonly/>
Repair Name:<input type='text' name='repair_name[]' size='20' 
value='$STH->repair_name' readonly/><br />
Location: <input type='text' name='location[]' size='20' value='$STH->location' 
readonly/>
Description:<br /> <textarea id='' rows='5' cols='100' name='description[]' 
id='text'>$STH->description</textarea>
</div>";

The bottom half is pulled in from a separate php page using a jquery ajax call like so:

$(document).ready(function(){
$('#button1').click(function(){

$.ajax({
    url: 'http://localhost/php_site_copy/process.php',
    type: 'POST',
    data: {part_name: $('#partnomen').val()},

    success: function(msg){
                $('#result').html(msg);
            }

    }); //event handler

});

});

 <div id="result"></div><br />
<button id="button1">Add Repairs</button>

The goal here is to collect all of the data displayed into a $_POST from the page but I'm finding that I only get part of the array. The bottom part form elements are not picked up in the post at all and only some of the upper form elements.

You would think that this would work but I'm beginning to think I'm traveling down the wrong road when it comes to mixing content from different sources. Is there a standard that I'm missing or should I just put my nose back to the grindstone?

Edit: to answer quids' question, I'm using Firefox and the form arrangement is like so:

<form action='test_page.php' method='post'/>

<top html inputs/>

<middle inputs/>

<bottom inputs/>

<input type='submit' value='submit'/>

</form>
jhcorsair
  • 17
  • 3
  • Using content from mixed sources is fine. Nose back to the grindstone. – Jay Blanchard Dec 10 '14 at 20:50
  • How are you trying to post the form information? What browsers have you tested? I ran in to a problem once where dynamically created input elements weren't being pulled on a form post because of a security feature in internet explorer. The fix for me in that situation was a meta tag instructing IE to use version 8. There's nothing inherently wrong with using data from multiple sources though. – quid Dec 10 '14 at 20:56
  • Looks like it's back to the grindstone, thanks guys :) – jhcorsair Dec 10 '14 at 21:09

0 Answers0