Creator API and close window

Creator API and close window

Hi everyone - I've been working on this for a while, and can't seem to get Creator to do what I want.

I am using the Creator API to submit data.

I am able to get a new page to open using javascript, in a new window. But, in the original window, the data submission is shown.

I want to be able to close that window so the users don't see it.

I've tried a bunch of things, including window.close in "on success" in Zoho itself, to no avail.

Here is the code:

  1. <body>
    <form name="foodorder" method="post" action="action-here" >
    <textarea name="XMLString">
    <ZohoCreator><applicationlist><application name="app-name"><formlist><form name="Post_Method_Receiver_Test"><add><field name="Egg_Dishes_mandatory"><value>Pan Scrambled Eggs</value></field><field name="EggDishes"><value></value></field></add></form></formlist></application></applicationlist></ZohoCreator>

    </textarea>
    <input type="hidden" value="owner-name" id="zc_ownername" name="zc_ownername">
    <input type="hidden" name ="scope" id="scope" value="creatorapi">

    <table>
    <tr>
    <td class="category">Egg dishes</td>
    <td class="item"><input type="checkbox" name="Egg_Dishes_mandatory" value="Pan Scrambled Eggs" checked> Pan Scrambled Eggs<br></td>
    <td class="description"><b>Pan Scrambled Eggs</b><br/>
    Pasteurized liquid eggs or fresh cracked eggs (optional) with optional herb garnish which may include chopped parsley, chives, or scallions</td>
    <td><script type="text/javascript">Zoho.writeInput("Suggested_egg_price");</script></td>
    </tr>
    <tr><td>&nbsp;</td></tr>
    <tr>
    <td>Additional egg dishes</td>
    <td class="item"><input type="checkbox" name="EggDishes" value="Vegetable & Cheddar Scrambled Eggs"> Vegetable & Cheddar Scrambled Eggs<br></td>
    <td class="item"><input type="checkbox" name="EggDishes" value="Mexican Scrambled Eggs"> Mexican Scrambled Eggs<br></td>

    </tr>
    </table>


    <br>

     <input type="submit" value="Add Record" onClick="submitform();">
    </form>

    <script type="text/javascript">
    function submitform()
    {
      document.foodorder.submit();
      window.open("http://www.zoho.com");
      this.window.close();
    }
    </script>






































Any help would be greatly appreciated!