3 Replies - 912 Views - Last Post: 20 June 2011 - 08:05 PM

#1 billgilmer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 19-June 11

Problem with submit button will not export forms input to file

Posted 20 June 2011 - 06:18 PM

What I am looking for is a code so when I hit the submit button, it will create a log file and save the form to that log file.

The tool that I created is html based and it's on my local computer. I would like for it to create the log file on my local computer. Is it possible to have it export to a comma spaced file "Seen below"?

"Employee Name"
Location: Hours: Hours: Hours: Hours: Hours: Hours: Hours: Hours:

TOTALS: 0 0 0 0 0 0 0 0

"Employee Name"
Location: Hours: Hours: Hours: Hours: Hours: Hours: Hours: Hours:

TOTALS: 0 0 0 0 0 0 0 0


<!DOCTYPE html>

<html>

<head>

 

<title>

DEM Time Sheet

</title>

 

<h1 id="logo">

<a href="" title="">DEM Time Sheet</a>

</h1>

<form id="form26" name="form26" class="DEM Time Sheet  page" autocomplete="off" enctype="multipart/form-data" method="post" action="#public" novalidate>

<header id="header" class="info">

	<h2>Time Sheet</h2>

	<div></div>

</header>

<ul>

<li id="foli19" 		class="leftHalf     ">

<label class="desc" id="title19" for="Field19">

		Employee Name

</label>

<div>

<select id="Field19" name="Field19" class="field select medium" tabindex="3" > 

<option value="" selected="selected">

</option>

<option value="Brandon Bedner" 				>

Brandon Bedner

</option>

<option value="Miguel Castro" 				>

Miguel Castro

</option>

<option value="Bill Gilmer" 				>

Bill Gilmer

</option>

<option value="Jorge Hernandez" 			>

Jorge Hernandez

</option>

<option value="Samuel Herrera" 				>

Samuel Herrera

</option>

<option value="Gerardo Lopez" 				>

Gerardo Lopez

</option>

<option value="Paul Loria" 				>

Paul Loria

</option>

<option value="Ervin Mira" 				>

Ervin Mira

</option>

<option value="Josh Robinson" 				>

Josh Robinson

</option>

<option value="Jason Rudford" 				>

Jason Rudford

</option>

<option value="Jason Schnautz" 				>

Jason Schnautz

</option>

<option value="Raynaldo Villegas" 			>

Raynaldo Villegas

</option>

</select>

</div>

</li>

<label for="Field20">Last</label>

</span>

</li>

<li id="foli11" 		class="rightHalf      ">

<label class="desc" id="title11" for="Field11">

Project Name

</label>

<div>

<select id="Field11" name="Field11" class="field select medium" tabindex="3" > 

<option value="" selected="selected">

</option>

<option value="Arlington - 527" 				>

Arlington - 527

</option>

<option value="Arlington - 537" 				>

Arlington - 537

</option>

<option value="Arlington - 547" 				>

Arlington - 547

</option>

<option value="Blue Cat 1800" 					>

Blue Cat 1800

</option>

<option value="E US Hwy 90 - 3260" 				>

E US Hwy 90 - 3260

</option>

<option value="Elm - 762" 					>

Elm - 762

</option>

<option value="Elm - 762 Apt A" 				>

Elm - 762 Apt A

</option>

<option value="Elm - 762 Apt B" 				>

Elm - 762 Apt B

</option>

<option value="Ethel - 1125" 					>

Ethel - 1125

</option>

<option value="FM 78 - 3191" 					>

FM 78 - 3191

</option>

<option value="Heather - 21607" 				>

Heather - 21607

</option>

<option value="Hickory Forrest - 6430" 				>

Hickory Forrest - 6430

</option>

<option value="King - 1204" 					>

King - 1204

</option>

<option value="Klein - 319" 					>

Klein - 319

</option>

<option value="Lake Placid - 234" 				>

Lake Placid - 234

</option>

<option value="Lake Placid - 243" 				>

Lake Placid - 243

</option>

<option value="Lake Placid - 287" 				>

Lake Placid - 287

</option>

<option value="Lee - 130" 					>

Lee - 130

</option>

<option value="Martindale - 209" 				>

Martindale - 209

</option>

<option value="Monticello - 651" 				>

Monticello - 651

</option>

<option value="Monticello - 661" 				>

Monticello - 661

</option>

<option value="New Cove - 283" 					>

New Cove - 283

</option>

<option value="Oldtowne - 120" 					>

Oldtowne - 120

</option>

<option value="Plantation - 116" 				>

Plantation - 116

</option>

<option value="Prickly Pear - 1618" 				>

Prickly Pear - 1618

</option>

<option value="River Oak - 908" 				>

River Oak - 908

</option>

<option value="Terminal Loop - 1322" 				>

Terminal Loop - 1322

</option>

<option value="Trelawney - 137" 				>

Trelawney - 137

</option>

<option value="Turtle Lane - 310" 				>

Turtle Lane - 310

</option>

<option value="Vallaha - 9122" 					>

Vallaha - 9122

</option>

<option value="Wakefield - 649" 				>

Wakefield - 649

</option>

<option value="Weinert - 1058" 					>

Weinert - 1058

</option>

<option value="Weinert - 1072" 					>

Weinert - 1072

</option>

<option value="Weinert - 1078" 					>

Weinert - 1078

</option>

<option value="Weinert - 1084" 					>

Weinert - 1084

</option>

<option value="FM 78 DEM" 					>

FM 78 DEM

</option>

<option value="" 						>

</option>

</select>

</div>

</li>

<li id="foli4" 		class="date leftHalf     ">

<label class="desc" id="title4" for="Field4">

Date

</label>

<span>

<input id="Field4-1" name="Field4-1" type="text" class="field text" value="" size="2" maxlength="2"tabindex="4"	/>

<label for="Field4-1">MM</label>

</span> 

<span class="symbol">/</span>

<span>

<input id="Field4-2" name="Field4-2"type="text"	class="field text" value="" size="2" maxlength="2"tabindex="5" />

<label for="Field4-2">DD</label>

</span>

<span class="symbol">/</span>

<span>

<input id="Field4"name="Field4"	type="text" class="field text" value="" size="4" maxlength="4" tabindex="6" />

<label for="Field4">YYYY</label>

</span>

</li>

<li id="foli7" 		class="rightHalf     ">

<label class="desc" id="title7" for="Field7">

Start Time

</label>

<span class="hours">

<input id="Field10" name="Field10" type="text" class="field text" value="" size="2" maxlength="2" tabindex="9"/>

<label for="Field10">HH</label>

</span>

<span class="symbol minutes">:</span>

<span class="minutes">

<input id="Field10-1" name="Field10-1" type="text" class="field text" value="" size="2" maxlength="2" tabindex="10"/>

<label for="Field10-1">MM</label>

</span>

<span class="ampm">

<select id="Field10-3" name="Field10-3" class="field select" style="width:4em" tabindex="12">

<option value="AM" selected="selected">AM</option>

<option value="PM" >PM</option>

</select>

<label for="Field10-3">AM/PM</label>

</span>

</li>

<li id="foli21"	class="time rightHalf     ">

<label class="desc" id="title21" for="Field21">

End Time  

</label>

<span class="hours"> <input id="Field21" name="Field21" type="text" class="field text" value="" size="2" maxlength="2" tabindex="13" />

<label for="Field21">HH</label>

</span>

<span class="symbol minutes">:</span>

<span class="minutes">

<input id="Field21-1" name="Field21-1" type="text" class="field text" value="" size="2" maxlength="2" tabindex="14" />

<label for="Field21-1">MM</label>

</span>

</span>

<span class="ampm">

<select id="Field21-3" name="Field21-3" class="field select" style="width:4em" tabindex="16" >

<option value="AM" selected="selected">AM</option>

<option value="PM" >PM</option>

</select>

<label for="Field21-3">AM/PM</label>

</span>

</li>

<li id="foli9" class="     ">

<label class="desc" id="title9" for="Field9">

Notes

</label>

<div>

<textarea id="Field9" 

name="Field9" 

class="field textarea small" 

spellcheck="true" 

rows="10" cols="50" 

tabindex="17" 

onkeyup=""

></textarea>

</div>

</li>

<li class="buttons ">

<div>

<input type="hidden" name="DEM Time Sheet" id="DEM Time Sheet" value="dB5YAYUJLThQ1vViLqkRtO8PC6nWmLuPsz2BRQNT4gw=" />

<input id="DEM Time Sheet" name="DEM Time Sheet" class="btTxt submit" type="submit" value="Submit" onmousedown="doSubmitEvents(file:///home/bill/Desktop//report.txt);" /> 

</FORM>

</b>

</a>

</body>

</html>


Is This A Good Question/Topic? 0
  • +

Replies To: Problem with submit button will not export forms input to file

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Problem with submit button will not export forms input to file

Posted 20 June 2011 - 07:12 PM

Quote

I would like for it to create the log file on my local computer. Is it possible to have it export to a comma spaced file "Seen below"?

Generally, no. As a basic security measure, websites have absolutely no access to the local file system, beyond tightly controlled things like file input fields.

That said, it may be possible to use privileged browser specific code, like browser extensions, to do something like this. It would require the explicit consent, or even installation, from each user.


But if you are developing a client-side app, HTML and Javascript are definitely the wrong way to go. Something like C# or Java would be much easier to deal with.
Was This Post Helpful? 0
  • +
  • -

#3 billgilmer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 19-June 11

Re: Problem with submit button will not export forms input to file

Posted 20 June 2011 - 07:45 PM

Thank you for your fast reply.
I am quite new at this its like trying to teach an old dog a new trick 58 +.
I would be the only user and it only be use as a offline HTML.

View PostAtli, on 20 June 2011 - 07:12 PM, said:

Quote

I would like for it to create the log file on my local computer. Is it possible to have it export to a comma spaced file "Seen below"?

Generally, no. As a basic security measure, websites have absolutely no access to the local file system, beyond tightly controlled things like file input fields.

That said, it may be possible to use privileged browser specific code, like browser extensions, to do something like this. It would require the explicit consent, or even installation, from each user.


But if you are developing a client-side app, HTML and Javascript are definitely the wrong way to go. Something like C# or Java would be much easier to deal with.

Was This Post Helpful? 0
  • +
  • -

#4 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2874
  • View blog
  • Posts: 11,032
  • Joined: 15-July 08

Re: Problem with submit button will not export forms input to file

Posted 20 June 2011 - 08:05 PM

You simply can't do it with HTML. You would still have to treat it as if it was a server and you were accessing the content. This means, as has been said that you would need a server-side language. I will move this to Web Development for further discussion.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1