• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XenForo.alert Has Transparent Background

Snog

Well-known member
#1
I'm trying to trigger the standard dropdown alert when a user clicks a link with this code...

Code:
<a href="javascript:" onclick="XenForo.alert('{xen:phrase submission_received}','',3000);document.form.submit();" />{xen:phrase clickme}</a>
It works, but for some reason the alert that drops down has a transparent background.

Am I missing something here?
 

digitalpoint

Well-known member
#2
The background color is supposed to be transparent, but it's an image that causes the gradient looking thing... Maybe your image is missing?

It should be here:

/styles/default/xenforo/overlay/timed-message.png
 

Snog

Well-known member
#7
weird... works fine if I trigger that JS here or on my site.
I do believe that's because you aren't actually submitting the form.

The full code looks like this..

Code:
<form name="form" action="{xen:link threads/myfunction, $thread}" method="post" class="xenForm AutoValidator" data-redirect="on">
     <a href="javascript:" onclick="XenForo.alert('{xen:phrase submission_received}','',3000);document.form.submit();" />{xen:phrase clickme}</a>
     <input type="hidden" name="myvalue" value="1" />
     <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
</form>
If I break the submit by changing 'document.form.submit()' to 'document.form1.submit()' the alert works but obviously the form isn't submitted.

If I leave it as is with the correct form name, the alert has the transparent background and the form is properly submitted.

The reason I'm trying to use XenForo.alert is when you submit a form like this (using a link to submit the form), the standard php redirect with message doesn't display the message.
 
Last edited:

Snog

Well-known member
#8
I've decided to take a different approach to this. So, a fix isn't needed unless someone wants to post one for reference.