Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    68
    Thanks
    29
    Thanked 0 Times in 0 Posts

    Help with "SyntaxError: Unexpected EOF" error

    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)

    Code:
    $(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>")
    		.dialog({
    			autoOpen: false,
    			title: 'Basic Dialog'
    		});
    
    	$('#opener').click(function() {
    		$dialog.dialog('open');
    		// prevent the default action, e.g., following a link
    		return false;
    	});
    });
    
    </script>

  • #2
    New Coder
    Join Date
    Oct 2010
    Posts
    68
    Thanks
    29
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •