Jump to content

Recommended Posts

Posted (edited)

I made a form here that a user would enter song title, author, artist and lyrics into seperate fields. The form outputs this info into a formatted html template (in a new window) ready to be saved and used onsite.

 

It would make more sense for me to have the form mail the output instead of spawning a new window. I must be too waterlogged to figure it out cuz I'm getting nowhere fast.

 

Any ideas?

Thanks :unsure:

 

P.S. Here's the script

<html>

<head>

<script language =" javascript">

 

<!-- begin

function create(form) {       

if (confirm("create template?")) {       

lyricwin = window.open("","lyricwin","toolbar=no,width=570,height=450,directories=no,status=yes,scrollbars=yes,resize=

o,menubar=no");               

with (lyricwin.document) {               

writeln ("<html><br><head><br><br><title>"+ form.input1.value + "</title><br>");

writeln ("<link rel=stylesheet href=\"/css/songpagestyles.css\" type=\"text/css\"><br><br><br>");         

writeln ("</head><br><body><br>");               

writeln ("<?php<br>include $_SERVER['DOCUMENT_ROOT'].\"/alpha/songs/includes/songheader.inc\";<br>?><br><br>"); 

writeln ("<?php<br>include $_SERVER['DOCUMENT_ROOT'].\"/alpha/songs/includes/texttoggle.inc\";<br>?><br><br>");

writeln ("<table width=750 align=center border=0 cellpadding=5 cellspacing=1><br>");

writeln ("<tr valign=top align=center><br>");

writeln ("<td align=left><br>");

writeln ("<h1><pre><div id=lyr><br>");

writeln ("<font face=arial><br>");

writeln ("<!-----------------spacer-------------------><br>");

writeln (form.input1.value + "<br>");

writeln (form.input2.value + "<br>");

writeln (form.input3.value + "<br><br><br>");

writeln ("<pre>" + form.input4.value + "</pre>" + "<br>");

writeln ("<!-----------------spacer-------------------><br>");

writeln ("</div></pre></h1><br>");

writeln ("</td><br>");

writeln ("<td align=right><br><br>");

writeln ("<?php<br>");

writeln ("include $_SERVER['DOCUMENT_ROOT'].\"/alpha/songs/includes/google_ads.inc\";<br>");

writeln ("?><br><br>");

writeln ("</td><br>");

writeln ("</tr><br>");

writeln ("<tr valign=top align=center><br>");

writeln ("<td colspan=2><hr></td><br>");

writeln ("</tr><br>");

writeln ("</table><br>");

writeln ("</body><br>");

writeln ("</html><br>");

      }       

  }

}

// end -->

</script>

 

 

<body>

 

<center>

<form>

<table border = 0 cellpadding = 1>

<tr>

<td><b>Song Title:</b></td>

 

<td><input type="text" name="input1" size=61><br></td>

</tr><tr>

<td><b>Author(s):</b></td>

<td><input type="text" name="input2" size=61><br></td>

</tr><tr>

<td><b>Artist(s):</b></td>

<td><input type="text" name="input3" size=61><br></td>

</tr><tr>

<td><b>Lyrics :</b></td>

<td><textarea wrap=virtual name="input4" cols=45 rows=10></textarea></td>

</tr>

</table>

<br>

<input type =" submit" value="Create It!" onclick =" create(this.form)">

 

</form>

</center>

</body>

</html>

Edited by boxturt
Posted

Hey there ...

 

The only way to send a mail note is to use a script that runs on the server side. Your script runs on the client's computer.

 

So either you envoke some "Form mail" type of script that's ready made, or you send the data to a script (Perl/PHP) that sends out a mail note.

Posted

Thanks. Yes, yes - I'll have to try something of the sort.

 

This will of course require figuring it out.

 

Ohhhhhhhh the pain.................... :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...