Team:Groningen/create desc
From 2010.igem.org
(Difference between revisions)
Line 3: | Line 3: | ||
<script language="JavaScript"> | <script language="JavaScript"> | ||
var cur=""; | var cur=""; | ||
+ | var fouten =""; | ||
function characteristics() { | function characteristics() { | ||
var txt = ""; | var txt = ""; | ||
Line 31: | Line 32: | ||
} | } | ||
function post() { | function post() { | ||
- | |||
- | |||
var txt = ""; | var txt = ""; | ||
var ok = false; | var ok = false; | ||
- | if (document.inv.desc.value != "") { ok = true; } | + | if (document.inv.desc.value != "") { ok = true; } else { fouten += "Description is not provided"; } |
+ | |||
txt = characteristics()+"<b>Description</b><br>\n"+document.inv.desc.value+"<br><br>"+physprop()+"<br><br><b>Recommended working conditions/usage</b><br>"+document.inv.oper.value+"<br><br>"; | txt = characteristics()+"<b>Description</b><br>\n"+document.inv.desc.value+"<br><br>"+physprop()+"<br><br><b>Recommended working conditions/usage</b><br>"+document.inv.oper.value+"<br><br>"; | ||
Line 41: | Line 41: | ||
txt+='<form onSubmit="restore(); return false;" ><input type="submit"></form>'; | txt+='<form onSubmit="restore(); return false;" ><input type="submit"></form>'; | ||
if (ok) { | if (ok) { | ||
+ | |||
+ | $("#ans").show(); | ||
+ | $("#formpje").hide(); | ||
+ | |||
document.getElementById("ans").innerHTML = txt; | document.getElementById("ans").innerHTML = txt; | ||
+ | } else { | ||
+ | document.getElementById("fouten").innerHTML = fouten; | ||
} | } | ||
+ | |||
$('#my-link').click(); | $('#my-link').click(); | ||
Line 57: | Line 64: | ||
</script> | </script> | ||
<a id="my-link" href="#"> | <a id="my-link" href="#"> | ||
+ | <div id="fouten"></div> | ||
<div id="formpje"> | <div id="formpje"> | ||
<form name='inv' onSubmit="post(); return false;" > | <form name='inv' onSubmit="post(); return false;" > |
Revision as of 22:52, 26 October 2010