Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    alert boxes with form data

    hi

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

    e.g
    Code:
    <c:set var="output" value="hello displayed in alert box" scope = "request"/>
    
    <script> alert(output) </script>
    or

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

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,990
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    <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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •