Skip to main content
1-Visitor
February 27, 2012
Solved

User Input Box

  • February 27, 2012
  • 3 replies
  • 3800 views

Hello,

New to MC15 but getting along with the help of Google and this forum.

One question that I have yet to answer and would appreciate some basic help:

I want to be able to change a variable value via text box. However a text box formats entries as a string. I have researched it pretty extensively but with no joy.

Can anyone tell me how to easily get a text box to output a numeric value and not a string? I do not need to validate the info just have it spit out the numeric.

Much appreciated.

Thanks,

Chris

Best answer by RichardJ

Inside the listbox script, use the VBscript CDbl() function.

Outputs(0).Value = CDbl(TextBox.Text)

3 replies

RichardJ19-TanzaniteAnswer
19-Tanzanite
February 27, 2012

Inside the listbox script, use the VBscript CDbl() function.

Outputs(0).Value = CDbl(TextBox.Text)

1-Visitor
February 28, 2012

Richard,

Thank you.

That worked. I also found that I could use "WebControls."

Thanks again.

Chris

24-Ruby III
July 18, 2012

The other way is to use the built-in function "str2num" (this function returns a constant formed by converting string into a number):

Pic_1.PNG