Note that there are some explanatory texts on larger screens.

plurals
  1. POSending an ID with JavaScript
    text
    copied!<p>On my webpage I have this link: </p> <pre><code>&lt;\a onclick="#" class="compose"&gt;&lt;/a&gt; </code></pre> <p>By clicking the link, this script gets activated:</p> <pre><code>$(function(){ $('.compose').click(function() { // Button which will activate our modal $('#popup_bestanden_edit_name').reveal({ // The item which will be opened with reveal animation: 'fade', // fade, fadeAndPop, none animationspeed: 600, // how fast animtions are closeonbackgroundclick: true, // if you click background will modal close? dismissmodalclass: 'close' // the class of a button or element that will close an open modal }); return false; }); }); </code></pre> <p>The script above will make this DIV visible, wich is a popup:</p> <pre><code>&lt;div id="popup_bestanden_edit_name"&gt; &lt;div id="popupheading"&gt; Naam wijzigen &lt;/div&gt; &lt;div id="popupcontent"&gt; &lt;p&gt;&lt;form action="" method="post" name="naamwijzigen"&gt;&lt;input name="naam" type="text"&gt;&lt;/form&gt;&lt;/p&gt; &lt;a href="#" class="popupbutton green close"&gt;&lt;img src="&lt;?php echo $domein.'/images/confirm_popup/tick.png'; ?&gt;"&gt;Ja, wijzigen&lt;/a&gt; &lt;a href="#" class="popupbutton red close"&gt;&lt;img src="&lt;?php echo $domein.'/images/confirm_popup/cross.png'; ?&gt;"&gt;Nee, annuleren&lt;/a&gt; &lt;/div&gt; </code></pre> <p></p> <p>The popup that opens gives people the opportunity to edit a name of a document on the website. So when the link <code>&lt;\a onclick="#" class="compose"&gt;&lt;/a&gt;</code> is clicked, it has to send an id (<code>$fetch_row['id']</code>) to the popup, so I can use this in the further scripting.</p> <p>Does anyone know how to do this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload