Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.6K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

HTMLSelect gives a wrong ouput?

Guillermo:

Please try the following:

<%@ page language="java"  %>
<%@ taglib uri="/webMathematica-taglib" prefix="msp" %>
<html>
<head>
<title>TITULO</title>
<link rel=stylesheet type='text/css' href='css/estilo1.css'>
</head>
<body bgcolor="#ffffff" >
<form name="formulario" action="Test5.jsp" method="post">
Choose one option: 
<msp:evaluate>
HTMLSelect[{"OpA","OpB","OpC","OpD"}, {"2.4*10^-5", "0.32*10^(-5)", "2.1*10^-6", "4.2*10^-5"}, "dcf", SelectedValues -> {$$dcf}]
</msp:evaluate>
Or
<input type="text" name="dcfOptional" align="left" size="35" value="<msp:evaluate>MSPValue[$$dcfOptional,"0.0"]</msp:evaluate>" />
<input type="checkbox" name="dcfOptionalChbx" >
<br/>

<p class="azulpeque" align="center">Push EVALUATE <br />
<img src="images/help.gif" width="1%" heigth="1%" border="0"></p>
<center><input type="submit" name="btnSubmit" value="Evaluate"></center>
<!-- img name="results" src="images/results.gif" class="icon" align="absmiddle" border="0" width="100%"-->
<font class="rojo"><b>Input data</b></font>
<msp:evaluate>
If[$$dcfOptionalChbx==="on", $$dcf = $$dcfOptional];
HTMLTableForm[
MSPBlock[
{$$dcf}, {$$dcf}
]]
</msp:evaluate> 
</form>
</body>
</html>

If you are getting your HTMLSelect values from WL output, change it to a List of strings. This at least curtails the error you recieved. If you wish values < 10^-6 to be formatted in DecimalForm or NumberForm then manipulate what is retruned. Try pasting "0.32*10^(-5)" in a WL session and see what is returned (without the quotes).

enter image description here

The following is a modification to the last msp:evaluate

<msp:evaluate>
If[$$dcfOptionalChbx==="on", $$dcf = $$dcfOptional];
temp = MSPBlock[{$$dcf}, $$dcf];
temp2 = MSPFormat[NumberForm[temp, ScientificNotationThreshold -> {-8, 6}]];
HTMLTableForm[temp2]
</msp:evaluate>
<msp:evaluate>
temp3 = NumberForm[temp, ScientificNotationThreshold -> {-8, 6}];
HTMLTableForm[MSPFormat[temp3]]
</msp:evaluate>

Two similar path to change the threshold when you start to see number in the form 10^-x.

Hans

POSTED BY: Hans Michel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard