Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display results as text in a form 1

Status
Not open for further replies.

micawber

Programmer
Dec 10, 2002
71
GB
Hi,
I have a form that i am sending results to.

At the moment the results are sent to a text box i.e:

<input name="red" type="text" class="main" size="8">

Is there a way to display the results as just text without being in a text box?

The results are sent to the form via an 'if statement' in a javascript file. e.g:

if (document.calc.total.value == "100.00")
{
document.calc.red.value="15.00";
}

many thanks!
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script type="text/javascript">
function calculate(){
if (document.calc.total.value == "100.00")
document.getElementById('test').innerHTML = "50";
}
</script>
</HEAD>
<BODY>
<form name="calc">
<input type="text" name="total" onBlur="calculate()">
</form>
<div id="test"></div>
</BODY>
</HTML>


try this by entering 100.00 in the text box
 
thanks aravelli,
nothing seems to happen for me when i use the code above?
also if i send the results to a 'div' will i be able to send the results of the form to an email.
at the moment the results are sent to a text box, which works but it would look much better as just plain text.
thanks.
 
What you also can do is to keep a textField but to set it as readonly and to remove its borders with CSS.

Water is not bad as long as it remains outside human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top