The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Javascript confirmation box
I am trying to use the following script to create a Confirmation Popup box for my "Mark All Forums Read" link, but it isn't working.
In my Navbar template I placed the following at the top: Code:
<vb:literal> <script> <!-- function markAsRead() { var markRead= confirm("Do you really want to mark all forums as read?"); if (markRead== true) { window.location="forumdisplay.php?{vb:raw session.sessionurl}do=markread&markreadhash={vb:raw bbuserinfo.securitytoken}"; } else { } } //--> </script> </vb:literal> I changed the link for "Mark All Forums Read" to: Code:
<a href="javascript:markAsRead();"><b><font color=red>{vb:rawphrase mark_forums_read}</font></b></a> I end up getting the following error in my browser when trying to follow the link: Quote:
I noticed when the page changes, the URL shows up as: http://www.mysite.com/forumdisplay.php?{vb:raw session.sessionurl}do=markread&markreadhash={vb:ra w bbuserinfo.securitytoken} It looks like the hash and security tokens are not being passed in the Java Script as they were in vB3. I was able to use the following in vB3.8.5 and it works fine, but it isn't working in vB4.x: Code:
<script> <!-- function markAsRead() { var markRead= confirm("Do you really want to mark all forums as read?"); if (markRead== true) { window.location="forumdisplay.php?$session[sessionurl]do=markread&markreadhash=$bbuserinfo[securitytoken]"; } else { } } //--> </script> Code:
<a href="javascript:markAsRead();">$vbphrase[mark_forums_read]</a> Any help would be greatly appreciated! . |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|