Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I do this in all JS? 1

Status
Not open for further replies.

EdwardMartinIII

Technical User
Sep 17, 2002
1,655
US
I've been tasked to write a web page that collects support information, emails that information (and any attached file using a file dialog), and assigns a Case Number.

I've never used a File control before, so I get to learn that.

The Case Number counter is interesting, though.

The Client would PREFER a sequential case number generated, such as CaseID_xxxxx, where the first case is CaseID_00001, the second one is CaseID_00002, and so forth.

Off the top of my head, I didn't think JS could do that across many clients connecting, so proposed that Case IDs be built (for example) this way: CaseID_[yyyy][mm][dd][hh][mm][ss] and we're simply gambling that no two people will submit a Case at exactly the same second (I could use incremental seconds, I suppose to reduce that chance).

Is there a JS way of grabbing that sort of auto-numbering thing from the web server, or am I looking at something like writing my own Perl script that uses a file sitting on the server to do this?

Thanks!


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Correct, you still need a server side language: coldfusion, PHP, or perl...

JS can post/get data to/from the server but can't access the file system on the client or server. Thank goodness!



Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Yeah, I kinda figured that would be a HUGE ker-WTF for JS to be able to read from or write to the server.

I've currently talked him into letting me try the date-based thing.

Our host has a handy Perl script that emails form contents, although it can't email ATTACHMENTS. For now, we're going to focus on getting the CaseID assigned and the data to the Customer Service Department.


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
I would suggest you get on your hosts' web site and see what server side design options your account has, if any. Then, hopefully, you can pick a platform such as custom perl script and get design help on the solution at that forum.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Okay! My host had a basic form-mailing script, and this all came together very well.

The actual page is posted in a local directory (although there's no reason I can't post it in a protected subdirectory of our website), I use a lot of JS on the page to do validations and such, and then when they click the [Enter] button, I build a big "this is all the data you've submitted" alert, and display that.

The rest of the POST action happens, and the form contents are emailed to me.

Works like a charm!

Thanks for the clues to get there, Lyndon!

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top