Users can draw on my site using jQuery drag and drop.
To save the content that I use.
$('#mksave').click(function(){ $("#topmenu").animateHighlight("#a7bf51", 4000); var div_contents = $("#print").html(); $.post("save.php", { 'contents': div_contents }); alert('Your painting is saved'); })
Here I take the contents of the div form and save it through the save.php file.
Everything is still working.
What I want to do is when klicks mksave is used (so the function will be launched) the user will be asked to specify a name for the picture, after which I will send a variable with a message.
So there must be some kind of warning screen that asks for a name.
The question is, how can I get a warning screen with a text field, save the given input in var, so that the code looks like this:
$('#mkopslaan').click(function(){ $("#topmenu").animateHighlight("#a7bf51", 4000); var div_contents = $("#print").html(); var name =
Therefore, I do not want the name text field to always be visible, but only in the field that appears on the click.
Edit I was not understood.
The user MUST enter a name.
source share