473,471 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Saving of html form to server rather than locally

CassVox
1 New Member
I recently inherited some code that I need to adapt and I am just not a java or asp coder so need some assistance.

I have a web form created by converting an excel spreadsheet to html with several onClick events, specifically "Clear" (clears data), "Submit" (emails data) and "Save Draft" (saves draft lcoally). Customers input their data, the from works its magic and is then sent off per the clicks. User is not signed on so no session data is currently handled.

I need to make the following changes:

-Capture user session data with which to id each file when saved/submitted.

-I need to change "Save Draft" to save the draft to the server rather than the local computer.

-I need to save the finished html to the server as well as sent via email on "Submit".

Currently the forms handling this are html itself:

Expand|Select|Wrap|Line Numbers
  1.  <input id='clearBtn' class=button type=button value=' CLEAR  ' onClick='return clearForm();' onfocus='return hilite(this.id);'>
  2. <input id='submitBtn' class=button type=button value='SUBMIT' onClick='return submitForm();' onfocus='return hilite(this.id);'>
  3. <input id='saveBtn' class=button type=button value='  SAVE DRAFT ' onClick='return saveForm();' onfocus='return hilite(this.id);'>
  4. <input name='emailTo' type=hidden value='service@cassandrasvox.com'>
  5. <input name='emailFrom' type=hidden value='info@nutritionfactslabelservices.com'>
  6. <input name='emailSubject' type=hidden value='Scaled Recipe'>
  7. <input name='emailAttachment' type=hidden value='ScaledRecipe'>
  8. <input name='submitMessage' type=hidden value=''>
  9. <input name='nextPage' type=hidden value=''>
  10. <input id='formTitle' name='formTitle' type=hidden value='ScaledRecipe'>
  11. <input id='formHtml' name='formHtml' type=hidden><!-- end -->
to a javascript (only including the "SaveDraft" portion:
Expand|Select|Wrap|Line Numbers
  1. function saveForm(){var a="To save this file on your local machine, click OK and wait for the page to refresh.";a+="\nThen, using the File..Save As menu option, save the file using any name you choose.";alert(a);a=getElementsByTagNames("input,select");for(i=0;i<a.length;i++){var b=a[i].id,c=b.substr(1);document.getElementById(c)!=null&&(c=getCellValue(c),document.getElementById(b).setAttribute("data-default",c))}a="<html>"+document.getElementsByTagName("html")[0].innerHTML+"</html>";with(document.forms[0])formHtml.value=
  2. escape(a),action=version+"/workSave.asp",method="post",submit();return!0}function printForm(a){a!=""&&alert(a.replace(/\<br\>/gi,String.fromCharCode(10)));window.print()}function formatNumber(a,b){if(isNaN(parseFloat(a)))return 0;var c=b.match(/\.(0*)/mg);return number_format(a,c==null?0:c[0].toString().length-1)}
and the save.asp
Expand|Select|Wrap|Line Numbers
  1. <%
  2. on error resume next
  3. worksheet = unescape(request("formHtml"))
  4. response.write(worksheet)
  5. response.end
  6. %>
As is works beautifully no hitches... all validation works before sending as an email.

I have gotten as far as seeing that the file will need to be saved into a server directory and at least 2 mySQL tables updated.

I just can't wrangle the code.

Code examples? Directions? HELP?!

Thanks folks!
Oct 11 '11 #1
0 1745

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nancy | last post by:
Hi, Guys, I am new to Python. I am trying to following the example on http://www.modpython.org/live/current/doc-html/tut-pub.html In this example, it gives the following html code, <form...
1
by: Martin Mrazek | last post by:
Hi, I put almost ten pages long HTML form on our server. It sends filled data into DB. Filling takes almost one hour and users complain that they cannot save the partly filled form and continue...
16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
6
by: Vijay | last post by:
I need to generate HTML files based on the some codes. One HTML file per code. I have the link (ex:http://123.234.345.456/WebPages/GetTestData.aspx?SomeCode=25), by passing the code as parameter I...
8
by: Gert | last post by:
Hi, I have a form (server side) because of the filling of variables through the application. But now I need to post it to an url on submit. My .HTML form looks like this, but how to translate it...
6
by: catherine.bajis | last post by:
I have a small project to create some simple HTML forms. Rather than have our users go to our web page and 'SUBMIT' the form data, it would be easier for them to fill out a simple standalone form,...
7
by: kks | last post by:
Hi there: I have made a simple HTML form. I ONLY want this form for off-line purpose on my computer, not on the internet.. I don't want the form to go to email or on the web. If I fill-out the...
7
by: Dave Kelly | last post by:
There has to be a name for what I want to do and I don't know what words to google for. I have a form here: http://www.texasflyfishers.org/firstpage.htm I want to submit it to the server and...
1
by: jej1216 | last post by:
I just created my first HTML form that posts data to a php file which inserts data into a MySQL DB. It works! Now I need add validation for the fields. The tutorials I see refer to having...
3
by: ulett4501 | last post by:
So I have figured out all of the initial setup issues but now I am stumped. Mostly because I don't even know what to search for to answer my question. I have an html form online and when people click...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.