I just got this outline request from...

User 1964159 Photo


Registered User
156 posts

Hi all,
I just had this strange e-mail:
Another tech question if you have a quick answer: can we put a calculation on a web page? What I want is the following:

A cell in which the user enters a number (y) a hidden formula
100(x - y) / x display the result as
z %

No rush!
I'm glad there's no rush! :/ Clearly I will have to ask a lot more questions of this guy. I am about to embark on creating a members -only area on the site, (probably using CC's WEBSITE PASSWORD MANAGER and I am guessing this chap wants tto set our members some questions......a sort of self-test. :rolleyes: and :rolleyes:
Can I ask a very unfair question and enquire whether it is possible to create this sort of thing on a website? I would be totally lost at this stage, but is sounds like the creation of a huge databasse!
User 184085 Photo


Ambassador
1,707 posts

Sounds like he want's to set up a "You must be this smart to get in" area.
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 38401 Photo


Senior Advisor
10,951 posts

Not sure how easy this is, but it's something someone else posted a few days ago which might be what you're looking for:

http://css-tricks.com/examples/DynamicOrderForm/
User 131437 Photo


Ambassador
151 posts

This simple javascript should help get you started. Not sure what it's for. x being undefined I valued it at 100 for working script.

<html>
<head>
<script type="text/javascript">
function show_prompt()
{
var x=100;
var y=prompt("Enter Variable","0");

if (y!=null && y!="")
{
var a=x-y;
var b=100*a;
var z=a/x;
document.write("Result: " + z);
}
}
</script>
</head>
<body>

<input type="button" onclick="show_prompt()" value="Calculate" />

</body>
</html>
Visit <a href="http://leviabbott.com" target="_blank">LeviAbbott.com</a>!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.