-1

how come this doesnt echo out on my page? supposed to be an ajax call:

Trying to write a form tag to the #quantity div.

echo '<script type="text/javascript">' . "\n";
echo '$("#quantity").append(function(index, html) { '. "\n";
echo 'return' . "\n";
echo '<form name="f1" id="f1"><input name="f1" id="f_1" type="hidden" value="1235" /></form>' . "\n";
echo '  });' . "\n";
echo '</script>' . "\n";
Sean
  • 63
  • 1
  • 2
  • 10
  • 1
    possible duplicate of [How would one echo this jQuery in PHP](http://stackoverflow.com/questions/4784012/how-would-one-echo-this-jquery-in-php) – RobertPitt Apr 20 '11 at 22:58
  • http://stackoverflow.com/search?q=headers+already+sent – Pekka Apr 20 '11 at 22:58

1 Answers1

1
<script>
var elem = '<form name="f1" id="f1"><input name="f1" id="f_1" type="hidden" value="'<?php echo $items["rowid"]; ?>'" /></form>';
$('#quantity').append(elem);
</script>

You were missing the single quotes around your PHP.

Kevin Ennis
  • 14,226
  • 2
  • 43
  • 44