views:

26

answers:

0

I have an image that when you click it its suppose to call another function and open a window.

It works the first time you click it but when you close the window and click on it again nothing happens. I've checked the script debugger it does infact get into the method the 2nd time but nothing happens even when i step through.

Markup:

<input type="image" src='../images/2D_01.gif' onmouseover='this.src="../images/2D_01-down.gif";' onmouseout='this.src="../images/2D_01.gif";' name="cmdDraw2D" onclick="return drawCad(true);">

<form id="frmMain" method="post" name="frmMain">

Javascript:

 function drawCad(flg2d)
 {
  // Validate any user input required
  if (validateUserInput())
  {
   // Hide the car wall alert
   showCarWallAlert(false);

   // Set the action and target of the page
   // Post the informtion to the saveBasicAndSpec.asp page
   if (flg2d)
    $("#frmMain").attr("action", "saveBasicAndSpec.asp?action=2d");
   else
    $("#frmMain").attr("action", "saveBasicAndSpec.asp?action=3d");

   $("#frmMain").attr("target", "_new");

   // Return statement used for firefox
   return true;
  }
  else
   return false;
 }