How to prevent user from leaving specific Form in a Page has many Form?
<p>I'm working on a website which shows images. Eeach image has just one description which can be edited or added by any user. Accordingly, there are 2 forms: one for adding and the second for inserting <strong>at the same page</strong>. I displayed the form which I need and hid what I don't by javascript.</p>

<p>My question is how can I prevent the user from leaving the specific form (<strong>not all page and the same URL</strong>)?</p>

<p>To be clearer, I will tell you the senario precisely </p>

<pre><code>IF (There is no description) 
showing adding button
 else (there is a description)
showing the description found ih the DB as a paragraph and editing button 
</code></pre>

<p>Once the user clicks the adding button, a form with a text area for adding will be shown. And the same goes with editing. I WANT TO PREVENT THE USER FROM LEAVING WHEN ONE OF THE FORMS IS SHOWN. Hopfully things are clearer now ! </p>

<p>Thanks in Advance!!</p>
