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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms - Pure HTML nad JavaScript only... 1

Status
Not open for further replies.

Lupo

Programmer
Oct 29, 2001
31
0
0
CH
I think a have a black out, maybe I had one over the eight last night. :)

I have the following problem I can't resolve. I've got the order from my boss to write a browser (only IE) based data maintenance "tool" (address). My problem is, this "tool" must be able run on every webserver (IIS, Apache, Abyss, Jana, etc.) and the data have to be sent by email without any mailer (JMail, Cdonts, etc.)... please don't laugh, that's the trough.

Until now it's not a problem. The problem is, everything should be written in just one file. A "drop-down list" with 21 roles (e.g. suppliers, graphic designer, product manager, etc.) and 8 different form types. Based on the role different data have to be entered and/or the e-mail has to be sent first for approval before it will be sent to the data administrator. Furthermore, based on the selected role only the relevant form should be on the screen.

Due to all this facts, I think I can only use pure HTML and JavaScript. But, how? Is anyone out there who can help me with this problem? Thanks in advance for any hints?



WEB Designer & WEB Developer (as per my working contract) and ASP Newbie :)
 
You'll need to use a scripting language like ASP, PHP, or Cold Fusion. In your case, I'd focus your time on PHP. This is as a result of the "non-server-specific" requirement. PHP has built-in mail features. You just need a SMTP server to relay from.

Does that help?
-Ron

-We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are.
 
The forms you could do entirely client-side in one file, but as Ron mentioned, you'd need server-side code to be able to provide the mail functionality.

Dan
 
@Ron & Dan

Hi,

I tried to proceed the following form on my old laptop (2wk with IE 6 and Outlook Express, no IIS, no Apache).

Code:
<html>
  <head>
    <title>Data Maintenance</title>
    <basefont face=&quot;Arial&quot; size=&quot;2&quot;>
  </head>

  <body>
    <h3>Data Maintenance</h3>
      <form action=&quot;mailto:yourname@company.tld&quot; method=&quot;post&quot; enctype=&quot;text/plain&quot;>
        <table border=&quot;1&quot; bordercolor=&quot;#111111&quot; width=&quot;40%&quot;>
          <tr>
            <td width=&quot;40%&quot;>First Line</td>
            <td width=&quot;60%&quot;><input type=&quot;text&quot; name=&quot;1st_Line&quot; size=&quot;40&quot;></td>
          </tr>
          <tr>
            <td width=&quot;40%&quot;>Second Line</td>
            <td width=&quot;60%&quot;><input type=&quot;text&quot; name=&quot;2nd_Line&quot; size=&quot;40&quot;></td>
          </tr>
          <tr>
            <td width=&quot;40%&quot;>Third Line</td>
            <td width=&quot;60%&quot;><input type=&quot;text&quot; name=&quot;3rd_Line&quot; size=&quot;40&quot;></td>
          </tr>
          <tr>
            <td width=&quot;40%&quot;>Forth Line</td>
            <td width=&quot;60%&quot;><input type=&quot;text&quot; name=&quot;4th_Line&quot; size=&quot;40&quot;></td>
          </tr>
        </table>
        <input type=&quot;hidden&quot; name=&quot;Remark&quot; value=&quot;Please check content and send it as 'Approved' to the data administrator.&quot;>
        <br><br>
        <input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;&quot;>&nbsp;&nbsp;<input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;Reset&quot;>
      </form>
  </body>
</html>

The email has been generated and transmitted successfully. I've opened the above HTML-File directly from my harddisk in IE. Do I really need server-side coding? Is IE and a mail client not enough to do that?





rgds Lupo
WEB Designer & WEB Developer (as per my working contract) [wink] and
Lupos.jpg
 
Interesting. I've never seen a form submit like that. I ran into a problem when I ran the code on my computer. IE crashed and the form data was not passed to my email client. I am using IE6 on WinXP with GroupWise for my email.

If the above code is going to be used on an Intranet, where you have control over the client workstations, then I'd say it might work. However, I get the impression from your first post that this is not going to be the case. If not, I doubt it will work because not everyone uses 2wk with IE 6 and Outlook Express. The email client needs to support this type of work and it is apparent to me that this is not the case.

I still think you're going to need some side of server-side processing. Sorry.

Sometimes technology has limitations which non-tech-savvy execs don't know about. They think that technology can do anything. Unfortunately this is not the case. What you are trying to do cannot be done reliably enough to use it in code which is to be made public. IMHO, you might need to tell your boss that it cannot be done if he doesn't relax some of the requirements.

-Ron

-We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are.
 
I've seen the &quot;mailto:&quot; used as a form action before but it's not desirable. It creates a HUGE security hole because 1) if your formn is visable to the internet, email sniffers will fond it and use it. 2) nasty things can be attached to the email with no check until it's opened :(

Go with the PHP method and save yourself, and your data admins, a ton of headaches.

There's always a better way. The fun is trying to find it!
 
@Ron

The above code will be used only on an Intranet. The client workstations are setup with W2K or XP and IE 5.0+ and Outlook (not Express).

I told my boss that it would be a lot easier for me if I could write it in ASP an submit all the data to a database. No chance! :-( He's the boss. ;-)

@tviman

Regarding 1) the form should not be visable to the internet only to an intranet (as per my boss). Regarding 2) IMHO it is not possible to attache nasty things to an e-mail which will be sent by a browser-based form. Or did you meant in combination with 1)?

I'am not (yet) familiar with PHP. Would PHP run on every webserver (IIS, Apache, etc.) without installation of any special modules?

Thanks in advance for the time you spent.


rgds Lupo
WEB Designer & WEB Developer (as per my working contract) [wink] and
Lupos.jpg
 
PHP will run on most major web servers as a module. Unfortunately, this would require installation of the php modules, which may not be possible in your case because your boss is being (seemingly) unreasonable. PHP is basically a scripting language like Cold Fusion, Perl, & ASP (except PHP is FREE).

You wouldn't need to store the information in a database as you mentioned in your most recent post. You could just use PHP to create & send the email, without saving any of the data. Also, he may have objections to using a scripting language because he thinks there will be a cost involved (which there wouldn't since PHP is free). Finally, if properly administered and written, PHP is very secure. Thousands of web sites use PHP without any security problems. Perhaps if he was given all the facts about this issue he might be more open to the idea.

It seems a little odd that this could be a &quot;real world&quot; issue. Most bosses are reasonable enough, if given all the correct facts, to understand what the limitations of the technology are. This, in fact, is a limitation of proper use of the technology. Use of HTML forms in this manner is not what they were designed for and may not reliably perform the way you want them to. He may be very disappointed if you write the app like he wants. If he wants that much control over the project, perhaps he should do it himself. Then, maybe he'd see the limitations that he's placing on you.

Are you sure they're not just &quot;testing&quot; you?

-Ron

-We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are.
 
@Ron

Hi Ron,

your comments are just great and very interesting to read.

I am pretty sure, that they do not &quot;testing&quot; me. I'am actually not in this million USD project. The reason i've got this job is, that they implement the browser-based data maintenance function not until phase 1 of the project is finished. They are already a behind the project schedule. He would like to have the data in a structured and complete form before starting phase 2 of the project.

I could do the job my boss asked for. Actually not with one file as he desired. I did it with 9 files (one with for dropdown list and one for each form type). I've used only HTML and Javascript. My boss is satisfied with this solution and I go now for my gap year (with 41) [wink]

Your promotion for PHP convinced me. I will start learning PHP during my gap year. BTW, I gave a print-out of the above to my boss. He was very impressed about your specifications!

Thanks again, merry christmas and a happy new year.

Dani


rgds Lupo
WEB Designer & WEB Developer (as per my working contract) [wink] and
Lupos.jpg
 
Merry Christmas & Happy New Year to you too. (and thanks for the star!) [wink]

-Ron

-We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top