c) Somewhere between the of your page, put the updating script:
<script type='text/javascript'> //remember that you could/should have only one of this
function updateMyDisplay() {
//plain html/javascript
document.getElementById('myDisplay').innerHTML="Thank you!";
.. or ..
//jquery
$('#myDisplay').html("Thank you!");
}
</script> //again : could/should have only one of this
...... The best way to implement such a thing (multiple displays with single modal) is to use the jQuery load():
on the main page or on the page of the script, create an empty hidden div:
then, populate that div with offline (non content in the same page) html pages
the form ....... in the myForm.html file
the thanking ... in the thankyou.html file
using jquery (for me the easiest thing out there):
.......
$('#myModal').load('myForm.html');
$('#myModal').height('650px');
$('#myModal').modal();
.......
// on completion of the form:
$('#myModal').load('thankyou.html');
$('#myModal').modal.update(); // (Eric Martin, himself, sent me this tip through Twitter)
.......
Anyways, if you are a "code borrower" ... like I am, you might have troubles undertanding the above but, in any case, I hope I have helped you.
SimpleModal only supports one modal open at a time.
Instead of opening a new one, you could get the content you want and replace the existing content with it.
I think that should instead be
$.modal.update();
There's only ever one modal dialog so you don't have to specify which one.There are too many ways to accomplish that. I will show you one of them:
a) Let's say that you are "simpleModal-ing" a div with id "myDisplay":
b) You, first, loaded the contents for the form in that page (div)
c) Somewhere between the of your page, put the updating script:
...... The best way to implement such a thing (multiple displays with single modal) is to use the jQuery load():
on the main page or on the page of the script, create an empty hidden div:
then, populate that div with offline (non content in the same page) html pages
the form ....... in the myForm.html file the thanking ... in the thankyou.html file
using jquery (for me the easiest thing out there):
Anyways, if you are a "code borrower" ... like I am, you might have troubles undertanding the above but, in any case, I hope I have helped you.