Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.



 
Post new topic   Reply to topic    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
Nolin Amoah
Smarty n00b


Joined: 22 Mar 2018
Posts: 3

PostPosted: Thu Mar 22, 2018 10:40 am    Post subject: Reply with quote

Hallo Leute, ich möchte sobald man auf einen Button drückt ein popup erscheint in dem man seine Mitgliedschaft beenden kann oder den Prozess abricht.
Dazu habe ich den unten stehenden Code eingefügt.

Code:

<style>
/* Popup container - can be anything you want */
.popup  {
    position: relative;
    display: inline-block;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin-top: 20px;
    font-size: 14px;
    {if $participant.Website == "OpinionHero"}border-color: #C9302C;{else}
    border-color: #286090;{/if}
    border-width: 3px;
    border-radius: 20px;">

}

/* The actual popup */
.popup .popuptext {
    visibility: hidden;
    width: 600px;
    background-color: #b6b6b6;

    text-align: center;
    border-radius: 6px;
    padding: 8px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -80px;
}

/* Popup arrow */
.popup .popuptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

/* Toggle this class - hide and show the popup */
.popup .show {
    visibility: visible;
    -webkit-animation: fadeIn 1s;
    animation: fadeIn 1s;
}

</style>



{if $status == 0}
   <form name="f" action="./" method="post">

   {"If you really want to cancel your membership, please activate the checkbox and press the button to confirm!"|_cl}<br />
   <br />

<div class="popup" onclick="myFunction()">
<span class="popuptext" id="myPopup" >A Simple Popup!</span>

         <input type="submit" name="panel_send" value="{"Cancel membership"|_cl}" class="btn btn-primary" />
   
<span class="popuptext" id="myPopup">
<form name="f" action="./" method="post">

   <br />
   <br />
        <br />
              

</form>



</span>       

{elseif $status == 1}
   {"Your membership has been canceled."|_cl}
{/if}



</div>
{literal}
<script>
// When the user clicks on div, open the popup
function myFunction() {
    var popup = document.getElementById("myPopup");
    popup.classList.toggle("popup");
}
</script>
{/literal}
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1212

PostPosted: Thu Mar 22, 2018 11:05 am    Post subject: Reply with quote

Great. What is your Smarty question?
Back to top
View user's profile Send private message
Nolin Amoah
Smarty n00b


Joined: 22 Mar 2018
Posts: 3

PostPosted: Thu Mar 22, 2018 11:47 am    Post subject: Reply with quote

Hello, i want to create in smarty a button that generates a popup window(not a browser window). In this window you can either choose to quit your membership or resign. I know from a certain standpoint that you need javascript to make that happen. Either as an 'if' statement or as a function like <script>function myFunction()....</scritpt>. I 've tried a lot of things but get no desired response.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1212

PostPosted: Thu Mar 22, 2018 11:54 am    Post subject: Reply with quote

No, I asked, what is your Smarty question.
So far, you're asking JavaScript/HTML questions.
Back to top
View user's profile Send private message
Nolin Amoah
Smarty n00b


Joined: 22 Mar 2018
Posts: 3

PostPosted: Thu Mar 22, 2018 12:01 pm    Post subject: Reply with quote

That was my question.

I'm working on a template that works with a smarty engine and uses javascript and html. I can add the source code in the buttom if it helps.

Sorry if i didn't make my self clear.

Code:

* Popup container - can be anything you want */
.popup  {
    position: relative;
    display: inline-block;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin-top: 20px;
    font-size: 14px;
    {if $participant.Website == "OpinionHero"}border-color: #C9302C;{else}
    border-color: #286090;{/if}
    border-width: 3px;
    border-radius: 20px;">

}

/* The actual popup */
.popup .popuptext {
    visibility: hidden;
    width: 600px;
    background-color: #b6b6b6;

    text-align: center;
    border-radius: 6px;
    padding: 8px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -80px;
}

/* Popup arrow */
.popup .popuptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

/* Toggle this class - hide and show the popup */
.popup .show {
    visibility: visible;
    -webkit-animation: fadeIn 1s;
    animation: fadeIn 1s;
}




</style>

{if $status == 0}
   <form name="f" action="./" method="post">

   {"If you really want to cancel your membership, please activate the checkbox and press the button to confirm!"|_cl}<br />
   <br />

<div class="popup" onclick="myFunction()">
<span class="popuptext" id="myPopup" >A Simple Popup!</span>

         <input type="submit" name="panel_send" value="{"Cancel membership"|_cl}" class="btn btn-primary" />
   
<span class="popuptext" id="myPopup">
<form name="f" action="./" method="post">

   <br />
   <br />
        <br />
              

</form>



</span>       

{elseif $status == 1}
   {"Your membership has been canceled."|_cl}
{/if}



</div>
{literal}
<script>
// When the user clicks on div, open the popup
function myFunction() {
    var popup = document.getElementById("myPopup");
    popup.classList.toggle("popup");
}
</script>
{/literal}
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1212

PostPosted: Thu Mar 22, 2018 12:08 pm    Post subject: Reply with quote

Yes, and? Smarty is just a glorified "print" statement.
All it does is outputs the binary stream to the client.
What is happening to it afterward, not to mentioned - how that binary stream is interpreted on receiving end, is completely outside Smarty's reach.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP