View Full Version : Help with "SyntaxError: Unexpected EOF" error

10-01-2012, 05:41 PM
I'm using query's ui dialog and i'm adding a form to the dialog box. If I use any spaces or returns between the tags I get the following error: SyntaxError: Unexpected EOF

If I move everything onto one line it fixes the problem, but it is obviously very difficult to read. Is there another way to handle this?

here is the script (it is working but difficult to read and make changes to)

$(document).ready(function() {
var $dialog = $("<div></div>")
.html("<form action='scripts/proc_registered_user.php' method='post' name='form' id='form' accept-charset='utf-8'><fieldset><input type='hidden' name='unreguser' value='%s' id='unreguser' /> <br /><h1>This is an unregistered user.</h1><p>....</p></fieldset><br /><p id='mail_submit'><input type='submit' value='Yes, Send an email' /></p></form>")
autoOpen: false,
title: 'Basic Dialog'

$('#opener').click(function() {
// prevent the default action, e.g., following a link
return false;


10-01-2012, 05:54 PM
Just remembered my form is being generated with dynamic content from the database. So instead how do I grab the form which is in a div with id='form' and insert it into the .html() part of the dialog function?