I have been working on this for hours, and I haven't been able to get it right.
I am using jquery to pull <address>
from an xml file. From there, I am using it to set that value to that of the hidden input. And from there, I would like to send the hmtl data to the .php file. I have tried everything I can think of and now it's 5:23AM.
Here is my HTML <input type="hidden" id="SenatorAddress" name="SA" />
Here is the JS: `
{
$('#StateSelect').change(function(){
$('#SenatorSelect').empty();
var state = $(this).val();
var select1 = $('#SenatorSelect');
var SAD = $('#SenatorAddress');
select1.append('<option value="Select a senator">Select a Senator</option>');
$(xml).find('member').each(function(){
if(state == $(this).find('state').text()){
var fname = $(this).find('first_name').text();
var lname = $(this).find('last_name').text();
select1.append("<option>"+fname+" "+lname+"</option>");
var sadress = $(this).find('address').text();
SAD.append(Sadress);
}
Here is the PHP:
The Honorable <?php echo $_GET["senatornames"]; ?><br>
<?php echo $_GET["SA"]; ?><br>
United States Senate<br />
Washington, DC 20510<br />