Jump to content

PHP HELP


sse2000

Recommended Posts

 

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

Link to comment
https://forums.phpfreaks.com/topic/163567-php-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.