Couple of JavaScript/HTML questions

Posted:
in Genius Bar edited January 2014
OK, first problem. What I need to do is insert an HTML form PLUS the Javascript to display an alert box that says:



?NAME_FROM_FORM, thank you for the following comments:

****comments****



Your input is appreciated.?



The HTML page will have 3 elements: name, email, and comments.



Now I know that the HTML will just be:



\t<tr><td align=right><font CLASS="bodytext"><b>Name:</b></font></td><td><input NAME="Name" TYPE="Text" SIZE="50"></td></tr>

\t\t\t

\t\t\t<tr><td align=right><font CLASS="bodytext"><b>E-mail Address:</b></font></td><td><input NAME="email" TYPE="Text" SIZE="50"></td></tr>

\t\t\t

<tr><td align=right><font CLASS="bodytext">Comments:</font></td><td><input NAME="comments" TYPE="Text" SIZE="50"></td></tr>





but I dont know how to do the alert so it will display the comments on submit.



[ 02-13-2003: Message edited by: TigerWoods99 ]</p>

Comments

  • Reply 1 of 3
    OK, I need to know how to pop-up a dynamic window that says ?CUSTOMER_NAME, would you like to buy a toupee with your Rogaine purchase. It?s only $5.99?for a limited time.? in Javascript. The original code is:





    &lt;form name=?formsAreCool? onsubmit=?return runJavascript();?&gt;

    ?

    &lt;input type=?hidden? name=?nameToShow? value=?Bob?&gt;

    ?

    &lt;input type=?submit?&gt;

    &lt;/form&gt;





    I tried something with the onLoad but it gave an error while doing it in IE. Can anyone help me?
  • Reply 2 of 3
    overhopeoverhope Posts: 1,123member
    How about attaching an onClick event to the submit button which runs a javascript alert box?



    Just an idea, and I haven't got the time to test it out right now...
  • Reply 3 of 3
    OnLoad should work in IE. Are you putting it in the body tag?



    [code]

    &lt;html&gt;

    &lt;head&gt;

    &lt;script language="JavaScript"&gt;

    function myScript(cName) {



    STRalert = cName + 'would you like to buy a...';

    alert(STRalert);

    }

    &lt;/script&gt;

    &lt;/head&gt;

    &lt; body bgcolor="white" 0nLoad="myScript('TigerWoods');" &gt;



    Your HTML Content Here



    &lt;/body&gt;

    &lt;/html&gt;

    </pre><hr></blockquote>



    Note: UBB wouldn't let me put onLoad in the code like that, so I used a Zero instead of an O (just in case you tried to copy and paste)
Sign In or Register to comment.