Fill a web document with web forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tadeo

    Fill a web document with web forms

    I want to make a web with a form with some fields.
    When the user submits they will generate a new web similar as this:

    Mr. <Somebody>:
    Your computer is <computer>
  • Grant Wagner

    #2
    Re: Fill a web document with web forms

    Tadeo wrote:
    [color=blue]
    > I want to make a web with a form with some fields.
    > When the user submits they will generate a new web similar as this:
    >
    > Mr. <Somebody>:
    > Your computer is <computer>[/color]

    -- page1.html

    <body>
    <form name="myForm" method="GET" action="page2.h tml">
    Your name: <input type="text" name="theName">
    <br>
    Your computer: <input type="text" name="theComput er">
    <br>
    <input type="submit" name="submitBut ton" value="Submit">
    </form>
    </body>

    -- page2.html

    <body>
    <script type="text/javascript">
    if (/theName=([^&]*)/.test(window.lo cation.search) && RegExp.$1) {
    document.write( 'Mr. ' + RegExp.$1 + '.<br>');
    } else {
    document.write( 'No name supplied!<br>') ;
    }
    if (/theComputer=([^&]*)/.test(window.lo cation.search) && RegExp.$1) {
    document.write( 'Your computer is ' + RegExp.$1 + '.<br>');
    } else {
    document.write( 'No computer supplied!<br>') ;
    }
    </script>
    </body>

    --
    Grant Wagner <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    Working...