sse2000 Posted June 24, 2009 Share Posted June 24, 2009 I need help with the following. I have a php webpage that contains javascript chemical drawing tool. The page also has an inline frame which stores data pertaining to a certain chemical. What happens now is once the chemical structure is drawn and the export button is selected it populates a textarea below the drawing tool with data pertaining to the drawn compound. What I would like to do is when the export button is selected the data to be transfered to a textarea located on the iframe form. I have pasted the code below. <?php ?> <div id="layer1" style="position:absolute; left:5px; top:10px;width:1000px; height:1000px;z-index:1; visibility:visible"> <script LANGUAGE="JavaScript1.1" SRC="../marvin.js"></script> <script LANGUAGE="JavaScript1.1"> <!-- function undo() { if(document.MSketch != null) { document.MSketch.undo(); } } function redo() { if(document.MSketch != null) { document.MSketch.redo(); } } function importMol(opts) { if(document.MSketch != null) { var s = document.MolForm.MolTxt.value; document.MSketch.setMol(s, opts); } else { alert("Cannot import molecule:\n"+ "no JavaScript to Java communication in your browser.\n"); } } function exportMol(format) { if(document.MSketch != null) { var s = document.MSketch.getMol(format); s = unix2local(s); // Convert "\n" to local line separator document.MolForm.MolTxt.value = s; } else { alert("Cannot import molecule:\n"+ "no JavaScript to Java communication in your browser.\n"); } } msketch_name = "MSketch"; msketch_begin("../", 485, 405); msketch_end(); //--> </script> <form NAME=MolForm onSubmit="return false"> <textarea NAME="MolTxt" ROWS=25 COLS=66> </textarea> <p> <input TYPE=BUTTON VALUE="Import" onClick="importMol('null')"> <input TYPE=BUTTON VALUE="Import SMARTS" onClick="importMol('smarts:')"> </p> <p>Export format: <select NAME="molformat"> <option VALUE="cml">cml</option> <option VALUE="csmol">csmol</option> <option VALUE="csrdf">csrdf</option> <option VALUE="csrxn">csrxn</option> <option VALUE="cssdf">cssdf</option> <option SELECTED VALUE="mol">mol</option> <option VALUE="mrv">mrv</option> <option VALUE="name">name</option> <option VALUE="rdf">rdf</option> <option VALUE="rxn">rxn</option> <option VALUE="smarts">smarts</option> <option VALUE="smiles">smiles</option> <option VALUE="sdf">sdf</option> <option VALUE="sybyl">sybyl</option> </select> <input TYPE=BUTTON VALUE="Export" onClick="exportMol(document.MolForm.molformat.value)"> <input TYPE=BUTTON VALUE="Undo" onClick="undo(document.MolForm.molformat.value)"> <input TYPE=BUTTON VALUE="Redo" onClick="redo(document.MolForm.molformat.value)"> </p> </form> </div> <div id="layer1" style="position:absolute; left:500px; top:0px;width:800px; height:1000px;z-index:1; visibility:visible"> <iframe src="../Axe" width="750" height="760" frameborder="no" scrolling="auto" name="news"></iframe></div> Thank you for your help Quote Link to comment Share on other sites More sharing options...
PugJr Posted June 24, 2009 Share Posted June 24, 2009 <?php ?> This is the PHP help board, so I would recommend you using some PHP before asking for help and where you need help in PHP. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.