google-code-export / nyromodal

Automatically exported from code.google.com/p/nyromodal
1 stars 1 forks source link

close nyromodal div with javascript function help! #585

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a div contening a form with one field and a validate button which call a 
javascript function 
if the field is empty then i show a alert to the user
else close the nyromodal div --> but i don't succeed in doing it

code :

<script>
   function valid1(){
      if(document.getElementById('field1').value=="") {
         alert('empty field1');
      }else{
         ??? --> close nyromodal div
      }
   }
</script> 

<div id="mydiv">
   <input type="text" id="field1" size="20">
   <input type="button" onclick="valid1()">
</div>

<a href="#mydiv">show form</a>

Original issue reported on code.google.com by joegi...@gmail.com on 4 Oct 2012 at 9:50