Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have never programmed in ASP.NET or used facebox for that matter of fact, but here's a couple of solutions from my little research that might work.</p> <p>There is a <code>reveal</code> function in the facebox source where the actual cloning is done:</p> <pre><code>reveal: function(data, klass) { $(document).trigger('beforeReveal.facebox') if (klass) $('#facebox .content').addClass(klass) $('#facebox .content').append(data) // &lt;--- This does the cloning </code></pre> <p>The extra comma is obviously from the original form field that has been repeated. You could bind a click() function to the submit button that submits the form and in that function remove one of the clones. Since this function should run before the form data is processed, the duplicates should be taken care of.</p> <pre><code>$("#my-submit-button").click(function() { $('#facebox .content').empty(); } </code></pre> <p>If that doesn't work, then this surely will. Facebox has a bunch of hooks to run your code after various events. One of the hooks is <code>reveal.facebox</code> or <code>afterReveal.facebox</code>. Since the cloning is done on reveal, you would have to bind a custom function to run at this event, and in that function change the id/names of all elements. Append a random word like <code>_temp</code> or something for each element. Not the exact code, but I hope you get the idea.</p> <pre><code>(document).bind('reveal.facebox', function() { $("#facebox .content &gt; *").each( // change the id's/name's ); }); </code></pre> <p><strong>Edit</strong>:</p> <p>Looking at the html for Facebox examples, it looks like it lives inside its own <code>&lt;div&gt;</code> and copies anything that has to be shown within that div. So the structure of a sample facebox page could look like:</p> <pre><code>&lt;html&gt; .. &lt;form runat="server"&gt; &lt;div id="myForm"&gt; // original form controls go here, probably hidden &lt;input id="theId" type="text" value="" /&gt; &lt;/div&gt; &lt;div id="facebox"&gt; ... &lt;div class="content"&gt; // the original form is copied inside this space and then displayed // this is the one the user interacts with and makes changes to &lt;input id="theId" type="text" value="new value" /&gt; &lt;/div&gt; ... &lt;/div&gt; &lt;/form&gt; .. &lt;/html&gt; </code></pre> <p>So based on this structure and example, the input box with <code>id=theId</code> appears inside <code>div#myForm</code> and <code>div#facebox</code>. <code>div#facebox</code> is the one with the updated values that we need.</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