Jump to content

Hiding Divs, and Resetting Values with "Onchange"


HeebieGB
 Share

Recommended Posts

Hi Everyone, I'm working on my first Javascript form, and would appreciate some advice.Below you will see a simple form i created, (using some wonderfull examples i found here and elsewhere) that does the following (or at least attempts to lol):#1

<script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script><script type="text/javascript">function changeDiv(the_div,the_change){  var the_style = getStyleObject(the_div);  if (the_style != false)  {    the_style.display = the_change;  }}</script><select name="select" onchange="changeDiv("this.value + div","block")">        <option value="Animal" selected="selected">Animal</option>        <option value="Vegetable">Vegetable</option>        <option value="Mineral">Mineral</option>      </select>

This is attempting to un-hide one of three div's hidden with the display:none method using the Onchange Event Handler. (full code below)I also need this event to re-hide both of the other 2 divs that won't be used and reset the values of the Select objects they contain to a blank, but i'm stuck where i am and can't move onward to that part yet.#2 is part of the same, The hidden Slect boxes, when shown/changed will show a description of the item selected, and when changed will hide any previously shown ones.I tried to use the value of the Select box directly at first which is why there is all the Kitten() etc functions sitting in there, but it didn't seem to work,calling my function with Onchange(this.value) So i tried to call the other function (Changediv) directly from the Onchange Event where This.value needed to have div on the end to match the names of my hidden divs Ie. Animaldiv, Vegetablediv, and MineraldivWould anyone show me what i'm doing wrong here?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head><script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script><script type="text/javascript">function changeDiv(the_div,the_change){  var the_style = getStyleObject(the_div);  if (the_style != false)  {    the_style.display = the_change;  }}function hideAll_comments(){  changeDiv("KittenComment","none");  changeDiv("PuppyComment","none");  changeDiv("BunnyComment","none");  changeDiv("CornComment","none");  changeDiv("CarrotComment","none");  changeDiv("PeaComment","none");  changeDiv("CoalComment","none");  changeDiv("IronComment","none");  changeDiv("QuartzComment","none"); }  function hideAll_Select(){  changeDiv("Animaldiv","none");  changeDiv("Vegetablediv","none");  changeDiv("Mineraldiv","none");}function Animal(){  hideAll_select;  changeDiv("Animaldiv","block"); }function Vegetable(){  hideAll_select;  changeDiv("Vegetablediv","block"); }  function Mineral(){  hideAll_select;  changeDiv("Mineraldiv","block"); }  function Kitten(){  hideAll_comments;  changeDiv("KittenComment","block"); }    function Puppy(){  hideAll_comments;  changeDiv("PuppyComment","block"); }   function Bunny(){  hideAll_comments;  changeDiv("BunnyComment","block"); } function Carrot(){  hideAll_comments;  changeDiv("CarrotComment","block"); }   function Corn(){  hideAll_comments;  changeDiv("CornComment","block"); }   function Peas(){  hideAll_comments;  changeDiv("PeaComment","block"); }   function Coal(){  hideAll_comments;  changeDiv("CoalComment","block"); }   function Iron(){  hideAll_comments;  changeDiv("IronComment","block"); }   function Quartz(){  hideAll_comments;  changeDiv("QuartzComment","block"); }</script><body><form id="form1" name="form1" method="post" action="">  <table width="100%" border="0" cellspacing="0" cellpadding="0">    <tr>      <td width="11%">First Name : </td>      <td width="89%"><input type="text" name="textfield2" /></td>    </tr>    <tr>      <td>Middle Initial: </td>      <td><input type="text" name="textfield" /></td>    </tr>    <tr>      <td>Last Name: </td>      <td><input type="text" name="textfield3" /></td>    </tr>    <tr>      <td>Select a Type: </td>      <td><select name="select" onchange="changeDiv("this.value + div","block")">        <option value="Animal" selected="selected">Animal</option>        <option value="Vegetable">Vegetable</option>        <option value="Mineral">Mineral</option>      </select></td>    </tr>    <tr>      <td>Choose one: </td>      <td><div id="Animaldiv" style="display:none">          <select name="select2">              <option value="Kittens">Kittens</option>              <option value="Puppies">Puppies</option>              <option value="Bunnies">Bunnies</option>            </select>        </div>        <div id="Vegetablediv" style="display:none">          <select name="select3">              <option value="Corn">Corn</option>              <option value="Carrots">Carrots</option>              <option value="Peas">Peas</option>            </select>        </div>        <div id="Mineraldiv" style="display:none">          <select name="select4">              <option value="Coal">Coal</option>              <option value="Iron">Iron</option>              <option value="Quartz">Quartz</option>            </select>        </div>      </td>    </tr>    <tr>      <td> </td>      <td><div id="KittenComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Kittens are Purrrrrrrrfect! </td>          </tr>          <tr>            <td>I <3 Kittens too! </td>          </tr>        </table>      </div>	  <div id="PuppyComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Puppies are Playfull! </td>          </tr>          <tr>            <td>I <3 Puppies too! </td>          </tr>        </table>      </div>	  <div id="BunnyComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Bunnies are Bounce-O-Riffic! </td>          </tr>          <tr>            <td>I <3 Bunnies too! </td>          </tr>        </table>      </div>	  <div id="CarrotComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Carrots are Orange </td>          </tr>          <tr>            <td>I <3 Carrot Cake </td>          </tr>        </table>      </div>	  <div id="CornComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Corn comes on a Cob! </td>          </tr>          <tr>            <td>I <3 Corn too! </td>          </tr>        </table>      </div>	  <div id="PeaComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Peas are green! </td>          </tr>          <tr>            <td>I think you're crazy... </td>          </tr>        </table>      </div>	  <div id="CoalComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Coal is black. </td>          </tr>          <tr>            <td>They mine it underground! </td>          </tr>        </table>		</div>		<div id="IronComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Iron can rust! </td>          </tr>          <tr>            <td>But it makes a fun Electromagnet! </td>          </tr>        </table>      </div>	  <div id="QuartzComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Quartz makes your Watch Work </td>          </tr>          <tr>            <td>I'd rather have a kitten  </td>          </tr>        </table>      </div>	  </div></td>    </tr>    <tr>      <td> </td>      <td> </td>    </tr>    <tr>      <td><input type="submit" name="Submit" value="Submit" /></td>      <td> </td>    </tr>  </table></form></body></html>

Link to comment
Share on other sites

Firstly, there is a syntactic error in your onclick event handler - you can't have the quotation marks in the hander. Change them to inverted commas. Then, I think you are trying to get the value of the select, so you need to put that outside quotation marks.

onchange="changeDiv(this.value + 'div','block')">

Finally, there is no native JS function called getStyleObject() that I have heard of. I think you want document.getElementById(). And finally, for the if you don't need the false bit

var the_style = document.getElementById(the_div);if (the_style)

There - try that.

Link to comment
Share on other sites

Whoops! I missed posting a bit of code which is what confused you on the Getstyleobject

function getStyleObject(objectId) {  if (document.getElementById && document.getElementById(objectId)) {    return document.getElementById(objectId).style;  } else if (document.all && document.all(objectId)) {    return document.all(objectId).style;  } else {    return false;  }

In either case i tried your suggestions and it was a no go. Mostly, I'm working to teach myself JS. I started this form a few weeks ago and have been tweaking it ever since, going from simple to more complex.Maybe it would be easier, to call another function directly instead of directly calling "Changediv" and trying to add text to the value when calling it.Here i have created a list of functions to be called directly, by the value of the select box which will perform the following actions to meet my needs,1: Hide all exposed Divs2: Show the required divI think this method would better suit my needs, as i can add a line to the overall function (for each value) to clear the unnecessary values when it is changed. (this is for later but just getting a point accross, as it is i could end up with 3 values when submitted one from each of the 3 hidden Select boxes if the user plays around with them, when i only want 1 between all 3, however i digress at this stage in developmet, it's not necessarily a concern) So, to call it via the "helper" functions such as Animal() What would be the correct Syntax to use? Is it as follows or, would i need single quotes, or maybe drop the () at the end since it has no modifiers?The basic need i have in this part is for each value of the select, to call a different function.

<select name="select" onchange="this.value()">        <option value="Animal" selected="selected">Animal</option>        <option value="Vegetable">Vegetable</option>        <option value="Mineral">Mineral</option>      </select>

List of helper functions:

<script type="text/javascript">function getStyleObject(objectId) {  if (document.getElementById && document.getElementById(objectId)) {    return document.getElementById(objectId).style;  } else if (document.all && document.all(objectId)) {    return document.all(objectId).style;  } else {    return false;  }function changeDiv(the_div,the_change){  var the_style = getStyleObject(the_div);  if (the_style != false)  {    the_style.display = the_change;  }}function hideAll_comments(){  changeDiv("KittenComment","none");  changeDiv("PuppyComment","none");  changeDiv("BunnyComment","none");  changeDiv("CornComment","none");  changeDiv("CarrotComment","none");  changeDiv("PeaComment","none");  changeDiv("CoalComment","none");  changeDiv("IronComment","none");  changeDiv("QuartzComment","none"); }  function hideAll_Select(){  changeDiv("Animaldiv","none");  changeDiv("Vegetablediv","none");  changeDiv("Mineraldiv","none");}function Animal(){  hideAll_select;  changeDiv("Animaldiv","block"); }function Vegetable(){  hideAll_select;  changeDiv("Vegetablediv","block"); }  function Mineral(){  hideAll_select;  changeDiv("Mineraldiv","block"); }  function Kitten(){  hideAll_comments;  changeDiv("KittenComment","block"); }    function Puppy(){  hideAll_comments;  changeDiv("PuppyComment","block"); }   function Bunny(){  hideAll_comments;  changeDiv("BunnyComment","block"); } function Carrot(){  hideAll_comments;  changeDiv("CarrotComment","block"); }   function Corn(){  hideAll_comments;  changeDiv("CornComment","block"); }   function Peas(){  hideAll_comments;  changeDiv("PeaComment","block"); }   function Coal(){  hideAll_comments;  changeDiv("CoalComment","block"); }   function Iron(){  hideAll_comments;  changeDiv("IronComment","block"); }   function Quartz(){  hideAll_comments;  changeDiv("QuartzComment","block"); }</script>

Link to comment
Share on other sites

In either case i tried your suggestions and it was a no go.
Oops, sorry, using my method the display assignment should look like this
the_style.style.display = the_change;

Link to comment
Share on other sites

Thanks Synook, That works Great! Now on to my Next Challenge, resetting the value of the 2 unused selects to a null when changed. I'll let you know when i get it running.Updated Full working code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><script type="text/javascript"><!--function changeDiv(the_div,the_change){  var the_style = document.getElementById(the_div);if (the_style)  {    the_style.style.display = the_change;  }}function hideAll_Select(){  changeDiv("Animaldiv","none");  changeDiv("Vegetablediv","none");  changeDiv("Mineraldiv","none");}function hideAll_Comments(){  changeDiv("KittenComment","none");  changeDiv("PuppyComment","none");  changeDiv("BunnyComment","none");  changeDiv("CornComment","none");  changeDiv("CarrotComment","none");  changeDiv("PeaComment","none");  changeDiv("CoalComment","none");  changeDiv("IronComment","none");  changeDiv("QuartzComment","none"); }// --></script></head><body><form id="form1" name="form1" method="post" action="">  <table width="100%" border="0" cellspacing="0" cellpadding="0">    <tr>      <td width="11%">First Name : </td>      <td width="89%"><input type="text" name="textfield2" /></td>    </tr>    <tr>      <td>Middle Initial: </td>      <td><input type="text" name="textfield" /></td>    </tr>    <tr>      <td>Last Name: </td>      <td><input type="text" name="textfield3" /></td>    </tr>    <tr>      <td>Select a Type: </td>      <td><select name="TypeSelect" onchange="hideAll_Select();hideAll_Comments();changeDiv(this.value + 'div','block')">        <option value="Animal" selected="selected">Animal</option>        <option value="Vegetable">Vegetable</option>        <option value="Mineral">Mineral</option>      </select></td>    </tr>    <tr>      <td>Choose one: </td>      <td><div id="Animaldiv" style="display:Block">          <select name="select2" onchange="hideAll_Comments();changeDiv(this.value + 'Comment','block')">              <option value="Kitten" selected="selected">Kittens</option>              <option value="Puppy">Puppies</option>              <option value="Bunny">Bunnies</option>            </select>        </div>        <div id="Vegetablediv" style="display:none">          <select name="select3" onchange="hideAll_Comments();changeDiv(this.value + 'Comment','block')">              <option value="Corn">Corn</option>              <option value="Carrot">Carrots</option>              <option value="Pea">Peas</option>            </select>        </div>        <div id="Mineraldiv" style="display:none">          <select name="select4" onchange="hideAll_Comments();changeDiv(this.value + 'Comment','block')">              <option value="Coal">Coal</option>              <option value="Iron">Iron</option>              <option value="Quartz">Quartz</option>            </select>        </div>      </td>    </tr>    <tr>      <td> </td>      <td><div id="KittenComment" style="display:block">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Kittens are Purrrrrrrrfect! </td>          </tr>          <tr>            <td>I <3 Kittens too! </td>          </tr>        </table>      </div>	  <div id="PuppyComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Puppies are Playfull! </td>          </tr>          <tr>            <td>I <3 Puppies too! </td>          </tr>        </table>      </div>	  <div id="BunnyComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Bunnies are Bounce-O-Riffic! </td>          </tr>          <tr>            <td>I <3 Bunnies too! </td>          </tr>        </table>      </div>	  <div id="CarrotComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Carrots are Orange </td>          </tr>          <tr>            <td>I <3 Carrot Cake </td>          </tr>        </table>      </div>	  <div id="CornComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Corn comes on a Cob! </td>          </tr>          <tr>            <td>I <3 Corn too! </td>          </tr>        </table>      </div>	  <div id="PeaComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Peas are green! </td>          </tr>          <tr>            <td>I think you're crazy... </td>          </tr>        </table>      </div>	  <div id="CoalComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Coal is black. </td>          </tr>          <tr>            <td>They mine it underground! </td>          </tr>        </table>		</div>		<div id="IronComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Iron can rust! </td>          </tr>          <tr>            <td>But it makes a fun Electromagnet! </td>          </tr>        </table>      </div>	  <div id="QuartzComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Quartz makes your Watch Work </td>          </tr>          <tr>            <td>I'd rather have a kitten  </td>          </tr>        </table>      </div>	  </div></td>    </tr>    <tr>      <td> </td>      <td> </td>    </tr>    <tr>      <td><input type="submit" name="Submit" value="Submit" /></td>      <td> </td>    </tr>  </table></form></body></html>

Link to comment
Share on other sites

Just finished it up and seems to be working great so far!Here's the full code for all the monkeys!The Form

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><script type="text/javascript"><!--function changeDiv(the_div,the_change){  var the_style = document.getElementById(the_div);if (the_style)  {    the_style.style.display = the_change;  }}function hideAll_Select(){  changeDiv("Animaldiv","none");  changeDiv("Vegetablediv","none");  changeDiv("Mineraldiv","none");}function hideAll_Comments(){  changeDiv("KittenComment","none");  changeDiv("PuppyComment","none");  changeDiv("BunnyComment","none");  changeDiv("CornComment","none");  changeDiv("CarrotComment","none");  changeDiv("PeaComment","none");  changeDiv("CoalComment","none");  changeDiv("IronComment","none");  changeDiv("QuartzComment","none"); }  function reset_values() { document.getElementById("animalselect").value = "" document.getElementById("vegetableselect").value = "" document.getElementById("mineralselect").value = "" }// --></script></head><body><form id="form1" name="form1" method="post" action="theaspemailer.asp">  <table width="100%" border="0" cellspacing="0" cellpadding="0">    <tr>      <td width="11%">First Name : </td>      <td width="89%"><input type="text" name="fname" /></td>    </tr>    <tr>      <td>Middle Initial: </td>      <td><input type="text" name="mi" /></td>    </tr>    <tr>      <td>Last Name: </td>      <td><input type="text" name="lname" /></td>    </tr>    <tr>      <td>Select a Type: </td>      <td><select name="TypeSelect" onchange="reset_values();hideAll_Select();hideAll_Comments();changeDiv(this.value + 'div','block')">        <option value="" selected="selected">Choose One</option>        <option value="Animal">Animal</option>        <option value="Vegetable">Vegetable</option>        <option value="Mineral">Mineral</option>      </select></td>    </tr>    <tr>      <td>Choose one: </td>      <td><div id="Animaldiv" style="display:none">          <select name="animalselect" onchange="hideAll_Comments();changeDiv(this.value + 'Comment','block')">              <option value="" selected="selected">Choose One</option>			  <option value="Kitten">Kittens</option>              <option value="Puppy">Puppies</option>              <option value="Bunny">Bunnies</option>            </select>        </div>        <div id="Vegetablediv" style="display:none">          <select name="vegetableselect" onchange="hideAll_Comments();changeDiv(this.value + 'Comment','block')">              <option value="" selected="selected">Choose One</option>			  <option value="Corn">Corn</option>              <option value="Carrot">Carrots</option>              <option value="Pea">Peas</option>            </select>        </div>        <div id="Mineraldiv" style="display:none">          <select name="mineralselect" onchange="hideAll_Comments();changeDiv(this.value + 'Comment','block')">              <option value="" selected="selected">Choose One</option>			  <option value="Coal">Coal</option>              <option value="Iron">Iron</option>              <option value="Quartz">Quartz</option>            </select>        </div>      </td>    </tr>    <tr>      <td> </td>      <td><div id="KittenComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Kittens are Purrrrrrrrfect! </td>          </tr>          <tr>            <td>I <3 Kittens too! </td>          </tr>        </table>      </div>	  <div id="PuppyComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Puppies are Playfull! </td>          </tr>          <tr>            <td>I <3 Puppies too! </td>          </tr>        </table>      </div>	  <div id="BunnyComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Bunnies are Bounce-O-Riffic! </td>          </tr>          <tr>            <td>I <3 Bunnies too! </td>          </tr>        </table>      </div>	  <div id="CarrotComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Carrots are Orange </td>          </tr>          <tr>            <td>I <3 Carrot Cake </td>          </tr>        </table>      </div>	  <div id="CornComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Corn comes on a Cob! </td>          </tr>          <tr>            <td>I <3 Corn too! </td>          </tr>        </table>      </div>	  <div id="PeaComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Peas are green! </td>          </tr>          <tr>            <td>I think you're crazy... </td>          </tr>        </table>      </div>	  <div id="CoalComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Coal is black. </td>          </tr>          <tr>            <td>They mine it underground! </td>          </tr>        </table>		</div>		<div id="IronComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Iron can rust! </td>          </tr>          <tr>            <td>But it makes a fun Electromagnet! </td>          </tr>        </table>      </div>	  <div id="QuartzComment" style="display:none">        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td>Quartz makes your Watch Work </td>          </tr>          <tr>            <td>I'd rather have a kitten  </td>          </tr>        </table>      </div>	  </div></td>    </tr>    <tr>      <td> </td>      <td> </td>    </tr>    <tr>      <td><input type="submit" name="Submit" value="Submit" /></td>      <td> </td>    </tr>  </table></form></body></html>

The ASP E-mailer

<%Dim ObjSendMailSet ObjSendMail = CreateObject("CDO.Message")      'This section provides the configuration information for the remote SMTP server.     ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="SMTP.server.com"ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60     ' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") =""'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") =""     ObjSendMail.Configuration.Fields.Update     'End remote SMTP server configuration section==     ObjSendMail.To = "Sendaddress@there.com"ObjSendMail.Subject = "Test Email"ObjSendMail.From = "E-mailaddress@here.com"     ' we are sending a text email.. simply switch the comments around to send an html email insteadObjSendMail.HTMLBody = "<p><strong>Email Form: Kittens Rule!</strong></p><p>First Name: "&request.form("fname")&"</p><p>Middle Initial: "&request.form("mi")&"</p><p>Last Name: "&request.form("lname")&"</p><p>Type: "&request.form("typeselect")&"</p><p>Animal: "&request.form("animalselect")&"</p><p>Vegetable: "&request.form("vegetableselect")&"</p><p>Mineral: "&request.form("mineralselect")&"</p>"'ObjSendMail.TextBody = ""     ObjSendMail.Send     Set ObjSendMail = Nothing %> 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...