...

View Full Version : alert boxes with form data



superman
11-19-2006, 02:17 PM
hi

I was wondering whether you can use alert boxes to display form data or variables you have declared

e.g

<c:set var="output" value="hello displayed in alert box" scope = "request"/>

<script> alert(output) </script>


or



<input name="name" type="text" />
<script> alert(param.name) </script>

Philip M
11-19-2006, 08:50 PM
<SCRIPT>
function showalert() {
alert (document.f.yourname.value);
}
</SCRIPT>

<form name="f">
<input name="yourname" type = "text" onblur="showalert()">
</form>

The syntax is document.formname.elementname.value



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum