Help with http header building?
Hello guys, i've being searching for how is it possible to get value of a form element i.e selection tag that was injected by jquery be access on submitting the form.
All the form element value where posted except for the selection element that was injected with jquery. how can i append the element value to the posted query?
Related Article: Header problem in php
is a solved PHP discussion thread by viktor.jiracek.5 that has 3 replies, was last updated 9 months ago and has been tagged with the keywords: header, problem, php, sent.
hakeemtunde
Junior Poster in Training
50 posts since Dec 2007
Reputation Points: 10
Solved Threads: 8
Skill Endorsements: 2
blocblue
Practically a Posting Shark
837 posts since Jan 2008
Reputation Points: 272
Solved Threads: 161
Skill Endorsements: 12
<select name="sectionname" id="section-name"></select>');
$.each( data, function(key, val){
$('#section-name').append('<option value="'+key+'">'+val+'</option>');
}
hakeemtunde
Junior Poster in Training
50 posts since Dec 2007
Reputation Points: 10
Solved Threads: 8
Skill Endorsements: 2
through JQuery
$('#section-tr').append('<td >Section: </td><td class="right len"><select name="sectionname" id="section-name"></select></td>');
$.each( data, function(key, val){
$('#section-name').append('<option value="'+key+'">'+val+'</option>');
}
hakeemtunde
Junior Poster in Training
50 posts since Dec 2007
Reputation Points: 10
Solved Threads: 8
Skill Endorsements: 2
thanks guys but i dont understand what you mean by "Just swap form-id with your actual form ID" GliderPilot.
But is it normal that what for what you append to html content not to be posted and access through script lang. (php) except through javascript? it will be of help if anybody can throw little light on this.
hakeemtunde
Junior Poster in Training
50 posts since Dec 2007
Reputation Points: 10
Solved Threads: 8
Skill Endorsements: 2
thanks guys but i dont understand what you mean by "Just swap form-id with your actual form ID" GliderPilot.
Change $('#form-id') to reflect the id attribute on your form. You must keep the # however.
If you post your complete code, so all of the form HTML, etc, people will be able to see exactly what your page looks like and why it might not be working.
Posting one or two lines of code isn't really helpful.
blocblue
Practically a Posting Shark
837 posts since Jan 2008
Reputation Points: 272
Solved Threads: 161
Skill Endorsements: 12
its like you are mis understanding my problem injecting code into html form and then submitting the form not through jquery but to php file that processes it is what am having problem about anything i appended to the dom with jquery doesn't come as part of the post ($_POST) data that was send to the php file. this is the problem not apppend another element to the form afterwhich dont comeup on php side. thanks but pls help
hakeemtunde
Junior Poster in Training
50 posts since Dec 2007
Reputation Points: 10
Solved Threads: 8
Skill Endorsements: 2
That's what I understood the problem to be too.
So if you post your complete code, we might be able to ascertain why it isn't working.
blocblue
Practically a Posting Shark
837 posts since Jan 2008
Reputation Points: 272
Solved Threads: 161
Skill Endorsements: 12
Well thanks guys am able to resolve the issue but in different way. on the form i created the select tag without options and from jquery i appended the options to it and on submitting the form php was able to access the select post variable.
on html page
<tr id="section-tr" style=background-color:#FFFF99;>
<td id="td1">Section: </td>
<td id="td2" class="right len">
<select name="section-name" id="section-name"></select></td>
</tr>;
then append the options with jquery
$.each( data, function(key, val){
$('#section-name')
.append('<option value="'+key+'">'+val+'</option>')
});
hakeemtunde
Junior Poster in Training
50 posts since Dec 2007
Reputation Points: 10
Solved Threads: 8
Skill Endorsements: 2
Question Answered as of 5 Months Ago by
GliderPilot
and
blocblue