Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Frontpage Newsgroups
Frontpage Programming
Can one include data from javascript in form
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Hot-text, post: 3970284"] The Beat JavaScript Editor - Ajax Editor AT:::: [URL]http://www.yaldex.com[/URL] YES it look like this >> BY [URL]http://www.freedback.com/[/URL] Give you something to work with !! ///////////////////////////////////////////////////////////////// //// //// //// CONFIRM-ORDER.HTM //// //// //// ///////////////////////////////////////////////////////////// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="Generator" CONTENT="TextPad 4.4"> </HEAD> <BODY> <center><BR><BR> JavaScript can take the contents of an HTML order form, process them, and display the order for verification even including the grand total! When the user confirms the order by clicking the button, the order is emailed to you by using freedback.com's free form processor cgi script. This script does take a bit of modification, but surely is worth it if you sell anything online. <BR> <form name=orderform action="confirm-order2.htm"> (Just check the items you wish to order.)<p> <table border=1> <tr> <td> <input type=checkbox name=item1A value="1A-Item_1_is_a_....*15.00$"></td> <td>1A</td> <td>Item 1 is a ....</td> <td>$15.00</td> </tr> <tr> <td> <input type=checkbox name=item2A value="2A-Item_2_is_a_....*30.00$"></td> <td>2A</td> <td>Item 2 is a ....</td> <td>$30.00</td> </tr> <tr> <td> <input type=checkbox name=item3A value="3A-Item_3_is_a_....*45.00$"></td> <td>3A</td> <td>Item 3 is a ....</td> <td>$45.00</td> </tr> <tr> <td colspan=4 align=center> <input type=submit value="Order"> </td> </tr> </table> ///////////////////////////////////////////////////////////////// //// //// //// CONFIRM-ORDER2.HTM //// //// //// ///////////////////////////////////////////////////////////// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="Generator" CONTENT="TextPad 4.4"> <script language="JavaScript"> <!-- Begin function decodeString() { valNum = new Array(); valData = new Array(); var string, length, dataCount, orderData, grandTotal; string = "" + unescape(location.search); string = string.substring(1,string.length); length = location.search.length; orderData = ""; dataCount = 1; for (var c = 0; c < string.length; c++) if (string.charAt(c).indexOf("&") != -1) dataCount++; orderData = "<table border=1 width=400>"; orderData += "<tr><td>Item</td><td>Description</td><td>Cost</td></tr>"; grandTotal = 0; for (var i = 0; i < dataCount; i++) { valNum[i] = string.substring(0,string.indexOf("=")); string = string.substring(string.indexOf("=")+1,string.length); if (i == dataCount-1) valData[i] = string; else valData[i] = string.substring(0,string.indexOf("&")); ampd = valData[i].indexOf("&"); pipe = valData[i].indexOf("-"); star = valData[i].indexOf("*"); line = valData[i].indexOf("$"); itemnum = string.substring(0,pipe); itemdsc = string.substring(pipe+1,star); itemcst = string.substring(star+1,line); string = string.substring(ampd+1,string.length); orderData += "<tr>"; orderData += "<input type=hidden name=item" + (i+1) + "num value='" + itemnum + "'>"; orderData += "<input type=hidden name=item" + (i+1) + "dsc value='" + itemdsc + "'>"; orderData += "<input type=hidden name=item" + (i+1) + "cst value='$" + itemcst + "'>"; orderData += "<td>" + itemnum + "</td>"; orderData += "<td>" + itemdsc + "</td>"; orderData += "<td>" + itemcst + "</td>"; orderData += "</tr>"; grandTotal += parseInt(itemcst); } orderData += "<tr>"; orderData += "<td colspan=2 align=center>Total</td><td>" + grandTotal + ".00</td>"; orderData += "</tr>"; orderData += "<tr>"; orderData += "<td colspan=3 align=center><input type=submit value='Confirm Order!'> or <a href='javascript:history.go(-1)'>Go Back</a></td>"; orderData += "</tr>"; orderData += "<input type=hidden name=grandtotal value='$" + grandTotal + ".00'>"; orderData += "</table>"; document.write(orderData); } function openThanks() { window.open("confirm-order-thanks.htm"); } // End --> </script> </HEAD> <BODY onUnload="openThanks()"> <center><BR> Here is where you confirm your order. The order is then emailed to the webmaster using freedback.com's free form processing cgi-script. This demo will mail the form to you if you enter your email address in the hidden field of this script. <BR><BR> <form method=post action="[URL]http://cgi.freedback.com/mail.pl[/URL]" name="emailform"> <input type=hidden name=to value="[email]you@your-web-site-address-here.com[/email]"> <input type=hidden name=subject value="** Order Form **"> <script language="JavaScript"> <!-- Begin decodeString(); // End --> </script> </form> </center> </BODY> </HTML> ///////////////////////////////////////////////////////////////// //// //// //// CONFIRM-ORDER-thank.HTM //// //// //// ///////////////////////////////////////////////////////////// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="Generator" CONTENT="TextPad 4.4"> </HEAD> <BODY Background=../graphics/grayback.jpg> <center><BR><BR><BR> If you pressed SUBMIT, Your order has been submitted. </center> </BODY> </HTML> and doing a Debugging with JS Syntax Check on the HTML you Posted >>> Line 57 Column 37 Error: Syntax error [/i][/i][/i][/i][/i][/i][/i] [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Frontpage Newsgroups
Frontpage Programming
Can one include data from javascript in form
Top