JavaScript - Disable Email Field Requirement
i'm using a shopping cart template and i do NOT want to require that shoppers have to enter their email address. how do I disable the requirement, but still ensure if they do type it in, that the format is correct (i.e. person@website.com)?
thanks! PHP Code: <?php if(! is_array($alladdresses)){ ?> if(frm.email.value==""){ alert("<?php print $xxPlsEntr?> \"<?php print $xxEmail?>\"."); frm.email.focus(); return (false); } validemail=0; var checkStr = frm.email.value; for (i = 0; i < checkStr.length; i++){ if(checkStr.charAt(i)=="@") validemail |= 1; if(checkStr.charAt(i)==".") validemail |= 2; } if(validemail != 3){ alert("<?php print $xxValEm?>"); frm.email.focus(); return (false); } Similar Tutorialsbeen trying to get the selection in the first field to change the next field only if the first selection is 'other' I do not get any errors and my code could be completely wrong. Can anyone see why the selection will not change the next fields status. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> <!-- function check_select(form, selection, other) { var theform = document.getElementById(form); var theselection = theform.selection.value; if ((theselection == "other")) { theselection.disabled = false; } else { theselection.disabled = true; } } --> </script> </head> <body> <form id="form1" name="form1" method="post" action=""> <select name="selection" onChange="check_select('form1', 'selection', 'other')"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="other">other</option> </select> <br> <br> <input id="other" type="text" name="other" disabled> </form> </body> </html> Requirements: i Each membership type selected is $20 per month (ie, if all 4 are selected then the monthly program fee is $80) ii if the membership is for 12 months then a 10% discount is applied to the program fee iii a 50% discount is to be applied to the program fee if the applicant is a UTT Student iv a 25% discount is to be applied to the program fee if the applicant is a UTT Staff member v a 15% discount is to be applied to the program fee if the applicant is either a Senior or Student from another school or university Here is what i have done..can you help me with it? Code: <?xml version= "1.0" encoding= "UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtm… <html xmlns= "http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script type="text/javascript"> total = 0; function ShowPFee(obj) { var price; var i; if (obj.checked) //user must have selected the box total = total + eval(obj.value); else //user must have DEselected the box total = total - eval(obj.value); document.getElementById("gymForm").P… = total; return; } function ShowPFee1(obj) { var df = document.forms["gymForm"], total = 0; var gym = df.MembershipType1, GroupFitness = df.MembershipType2, boxing = df.MembershipType3, tk = df.MembershipType4, months = df.MembershipTerm, pf = df.ProgramFee; if(gym.checked) {total = gym.value * eval(obj.value);} pf.value = total; if(GroupFitness.checked) {total = GroupFitness.value * eval(obj.value);} pf.value = total; if(boxing.checked) {total = boxing.value * eval(obj.value);} pf.value = total; if(tk.checked) {total = tk.value * eval(obj.value);} pf.value = total; return } </script> <link rel="stylesheet" type="text/css" href="practical2.css" /> <title> practical work online gym Form</title> </head> <body> <form name="gymForm" id="gymForm"> <p><b> Membership Type:</b> <input type="checkbox" name="MembershipType1" value="20" onclick="ShowPFee(this)" class="check-1" /> Gym <input type="checkbox" name="MembershipType2" value="20" onclick="ShowPFee(this)" class="check-2" /> Group Fitness <input type="checkbox" name="MembershipType3" value="20" onclick="ShowPFee(this)" class="check-1" /> Boxing <input type="checkbox" name="MembershipType4" value="20" onclick="ShowPFee(this)" class="check-2" /> Taekwondo </p> <p><b> Membership Category:</b> <input type="radio" name="MembershipCategory" value="Uws-Student" class="check-1" /> UTT Student - Student No: <input type="text" name="StudentNo" style="color:black; background-color:white" /> <input type="radio" name="MembershipCategory" value="UTT Staff" class="check-1" /> Uws Staff <input type="radio" name="MembershipCategory" value="Senior" /> Senior <input type="radio" name="MembershipCategory" value="General Public" class="check-1" /> General Public <input type="radio" name="MembershipCategory" value="Student other School/University" /> Student other School/University </p> <p><b> Membership Term: </b> <input type="radio" name="MembershipTerm" value=1 class="check-1" onclick="ShowPFee1(this)" /> 1 Month<input type="radio" name="MembershipTerm" value=6 class="check-2" onclick="ShowPFee1(this)" /> 6 Months <input type="radio" name="MembershipTerm" value=3 class="check-1" onclick="ShowPFee1(this)"/> 3 Months <input type="radio" name="MembershipTerm" value=12 onclick="ShowPFee1(this)" /> 12 Months Folks, I have been in IT for many years, but completely new to javascripting and ajax etc. I develop web sites and the php, html coding etc is no issue, its just that I have never needed to do any javascript coding and therefore have not used it at all. Picking it up should present little problem, but as of this moment, I am a complete tyro, and I need to get moving on this requirement ASAP. I have a requirement which I haver never before needed to address. I would be grateful for some pointers to resources (I have searched and searched..... ) which I could use to develop the functionality I need. After that rambling intro, here is the actual issue..... I need to have a variety of areas on a single picture on the website, each of which if clicked on, will go to a different article. Rather than try to explain, here is a link which does a similar thing, although this one is in Flash (which I also don't know): http://www.comcare.gov.au/virtual_wo...fice/reception I need to do pretty much the same thing, though with a different picture and words of course. The website will be a Joomla based site. I hope I have gived enough information, and indeed, hope that I have posted to the right area! Any assistance or thoughts at all would be greatly appreciated. regards to all, Mike Hello, I'm trying to make sure that my email field contains at least 5 characters and the @ symbol. I've been trying to do this using an if...else loop, but so far I've only been running into brick walls. I think my problem is I don't know what to use when it comes to document.form1.email.value This is the latest script I tried: Code: <html> <head> <title>Form Example</title> <script language="JavaScript" type="text/javascript"> function validate() { if (document.form1.yourname.value.length < 1) { alert("Please enter your full name."); return false; } if (document.form1.address.value.length < 3) { alert("Please enter your address."); return false; } if (document.form1.phone.value.length < 3) { alert("Please enter your phone number."); return false; } if (document.form1.email.value.length < 5) alert("Please enter at least 5 characters."); else if (document.form1.email.value.match(@)) alert("Please enter an @ symbol."); return false; return true; } </script> </head> <body> <h1>Form Example</h1> <p>Enter the following information. When you press the Submit button, the data you entered will be validated, then sent by email.</p> <form name="form1" action="mailto:user@host.com" enctype="text/plain" method="POST" onSubmit="return validate();"> <p><b>Name:</b> <input type="TEXT" size="20" name="yourname"> </p> <p><b>Address:</b> <input type="TEXT" size="30" name="address"> </p> <p><b>Phone: </b> <input type="TEXT" size="15" name="phone"> </p> <p><b>Email Address: </b> <input type="TEXT" size="30" name="email"> </p> <p><input type="SUBMIT" value="Submit"></p> </form> </body> </html> Hello I have a form validation script which checks for empty fields and an email address. The empty fields part seems to work, but not the validation (as long as I type characters in the email field, it seems to be acceptable). Here is what I have: Code: //function to check for empty fields function isEmpty(strfield1, strfield2, strfield3) { //change "name, email and subject" to your field names strfield1 = document.forms[0].ContactUs_Name.value strfield2 = document.forms[0].ContactUs_Email.value strfield3 = document.forms[0].ContactUs_Subject.value //name field if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ') { alert("\"Name\" is a mandatory field.\nPlease amend and retry.") return false; } //url field if (strfield2 == "" || strfield2 == null || strfield2.charAt(0) == ' ') { alert("\"Email\" is a mandatory field.\nPlease amend and retry.") return false; } //title field if (strfield3 == "" || strfield3 == null || strfield3.charAt(0) == ' ') { alert("\"Subject\" is a mandatory field.\nPlease amend and retry.") return false; } return true; } //function to check valid email address function isValidEmail(strEmail){ validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i; strEmail = document.forms[0].email.value; // search email text for regular exp matches if (strEmail.search(validRegExp) == -1) { alert('A valid e-mail address is required.\nPlease amend and retry'); return false; } return true; } //function that performs all functions, defined in the onsubmit event handler function check(form){ if (isEmpty(form.ContactUs_Name)){ if (isEmpty(form.ContactUs_Email)){ if (isEmpty(form.ContactUs_Subject)){ if (isValidEmail(form.email)){ return true; } } } } return false; } </script> </head> <body bgcolor="#ECECEC" text="#000000"> <h3>Form validation with JavaScript</h3> <form name="theform" method="post" action="#" onSubmit="return check(this);"> Name:<br /> <input name="ContactUs_Name" type="text" /><br /> E-Mail:<br> <input name="ContactUs_Email" type="text" id="ContactUs_Email" /> <br /> Subject:<br> <input name="ContactUs_Subject" type="text" id="ContactUs_Subject" /> <br> I just wondered, is it here that the problem lies: if (isValidEmail(form.email)){ Thanks. Steve I have a web form that requests a user full name and email address. What I would like to do is when the user fills in the full name in one input box, I would like to take the full name and populate the email address field as such. "first.last@allstate.com". So pretty much split the full name and popluate email address field "first.last@allstate.com". Tracy Hello: I have an expression validating email addresses but it seems there is a loophole. If a user enters a comma this is accepted. Can anyone tell me how i can modify the following to disallow commas? validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i; strEmail = document.form1.df_email1.value; if (strEmail.search(validRegExp) == -1) { alert("A valid e-mail address is required."); document.form1.df_email1.focus(); return false; } Hey All, Been having some trouble with this, I am trying to find a javascript or DHTML form field which is similar to the outlook web access email address fields which show an icon to identify the address, and the screen name of the address instead of the full email address, as a hyperlink. I was wanting to know if anyone knows of something like this already around or if I need to design my own. Thanks in advance. here is my current email validation code: function validateEmail(strValue) { var objRegExp = /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i; return objRegExp.test(strValue); } what should i add to reject email addresses from hotmail.com and yahoo.com? so that the form only submits when 2 fields are identical? this is the code I am trying to edit Code: <div class="title">ENROLLMENT</div> <p>You are on your way to receiving <strong>generous cash backs</strong> <em>PLUS</em> a <strong>steady stream of free dinners</strong> just for shopping at your favorite stores!</p> <br /> <form action="" class="registration" id="cform"> <div> To begin, please complete the following:<br /> <div class="f11"> <input type="text" name="name" value="Name:" onfocus="if(this.value=='Name:')this.value=''" /><br /> <input type="text" name="address" value="Address:" onfocus="if(this.value=='Address:')this.value=''" /><br /> <input type="text" name="phone" value="Phone:" onfocus="if(this.value=='Phone:')this.value=''" /><br /> <input type="text" name="email" value="E-mail:" onfocus="if(this.value=='E-mail:')this.value=''" /><br /> <input type="text" name="confirm" value="Confirm Email:" onfocus="if(this.value=='Confirm Email:')this.value=''" /><br /> <fieldset style="width:330px"> How would you like your free restaurant gift certificates sent to you? <br /> <input class="checkbox" name="gift_1" id="c1" type="checkbox" value="yes" /> <label for="c1">U.S. Mail</label> <input class="checkbox" name="gift_2" id="c2" type="checkbox" value="yes" /> <label for="c2">E-mail</label> </fieldset> </div> <br /> <div class="align-center"><a href="javascript:void(0);" id="sbm"><img alt="" src="images/button-submit.gif" /></a></div> </div> </form> <center><img src="/images/registration.jpg" ALT="registration" class="border" style="margin-top:20px" /></center> Code: /** * @author bob4ik */ $(document).ready(function(){ html = '<div id="displayResponse" style="display:none;"><div id="inner">Processing...</div></div>'; $('#cform').before(html); $('#sbm').click(function(){ $('#cform').submit(); }); var options = { target: '#displayResponse', // target element(s) to be updated with server response beforeSubmit: before, // pre-submit callback // success: success, // post-submit callback url: 'includes/mail.ctrl.php', // override for form's 'action' attribute type: 'post', // 'get' or 'post', override for form's 'method' attribute resetForm: true // reset the form after successful submit }; // bind to the form's submit event $('#cform').submit(function(){ error = '<div id="inner">Processing...</div>'; $('#displayResponse').empty(); $('#displayResponse').append(error); $('#displayResponse').toggle(); $(this).ajaxSubmit(options); return false; }); }); function before(formData, jqForm, options){ var error = ''; var form = jqForm[0]; if (!form.name.value && !form.email.value && !form.address.value && !form.phone.value && !form.hear.value && !form.confirm.value) { error = error + '<div style=""><b>Please fill all fields</b></div>'; } else { if (!form.name.value||form.name.value=="Name:")error = error + '<div style=""><b>Please fill "Name" field</b></div>'; if (!form.address.value||form.address.value=="Address:")error = error + '<div style=""><b>Please fill "Address" field</b></div>'; if (!form.phone.value||form.phone.value=="Phone:")error = error + '<div style=""><b>Please fill "Phone" field</b></div>'; if (!form.c1.checked && !form.c2.checked)error = error + '<div style=""><b>Please fill "How would you like your free restaurant gift certificates sent to you?" field</b></div>'; if (!form.email.value||form.email.value=="E-mail:")error = error + '<div style=""><b>Please fill "E-mail address" field</b></div>'; if (!form.confirm.value||form.confirm.value=="Confirm Email:")error = error + '<div style=""><b>Please fill "Confirm E-mail address" field</b></div>'; if ((form.email.value.match(/[0-9a-z_]+@[0-9a-z_^.]+.[a-z]{2,3}/i) == null) && form.email.value && (form.email.value.match(/^.+@.+\..+$/) == null)&& form.email.value!="E-mail:") { error = error + '<div style=""><b>Invalid e-mail</b></div>'; } if ((form.confirm.value.match(/[0-9a-z_]+@[0-9a-z_^.]+.[a-z]{2,3}/i) == null) && form.confirm.value && (form.confirm.value.match(/^.+@.+\..+$/) == null)&& form.confirm.value!="Confirm Email:") { error = error + '<div style=""><b>Invalid e-mail</b></div>'; } } if (error != '') { error = error + '<br><a href="#" onclick="javascript: $(\'#displayResponse\').toggle(); return false;"><img src="images/close.gif" border="0"></a>'; error = '<div id="inner">' + error + '</div>'; $('#displayResponse').empty(); $('#displayResponse').append(error); return false; } else { return true; } } hiiii, im new to javascripts . Can anyone help me to know that a javascript which is validating a phone number accepts only digits but if the text field is left empty it should accept the entry as an empty entry.... plz share knowledge u will be more knowledgeable Hi folks. Looking to see if anyone could tell me where I'm going wrong with this script... I'm trying to have a field automatically filled with the day of the week ("Monday", "Tuesday", "Wednesday" and so on), upon the user selecting a date from the datepicker jQuery. If this isn't clear, I'll clarify further down the page. Here is the script: Code: <script type="text/javascript"> jQuery(document).ready(function($){ $('input[name="item_meta[428]"]').change(function(){ var d = $('input[name="item_meta[428]"]').val(); var n = new Date(d).getDay(); if(n == 0) val v = 'Sunday'; else if(n == 1) val v = 'Monday'; else if(n == 2) val v = 'Tuesday'; else if(n == 3) val v = 'Wednesday'; else if(n == 4) val v = 'Thursday'; else if(n == 5) val v = 'Friday'; else if(n == 6) val v = 'Saturday'; $('input[name="item_meta[429]"]').val(v).change(); }); }); </script> I'm basically trying to say, if the user selected today (15/05/2012) in the field 428 it would fill the field 429 with "Tuesday". Again, if the user selected 18/05/2012 in the field 428 then it would automatically fill field 429 with "Friday". It's being done to work in conjunction with a wordpress plugin called Formidable Pro hence the item_meta[428] etc. Any assistance would be greatly appreciated. Sam. I have a text field, call it income, that when the input is > 0 I need to dynamically show the next text box, and if it is blank hide the next text box. I would like to use onBlur but can't seem to get it to work. Can I do this? Help I have two drop down fields. When I select any value in the first drop down i want the second dropdown to automatically populate the value related to the first one. For e.g i have the first field as name and the second field as measured in. If I select 'Potato' in the first dropdown then the second drop down should populate 'kg'. Please help.
Hi Experts, I have designed an online registration system for a non profit in ASP/SQL. After the members register for classes they are automatically redirected to an invoice page with class fees. At the bottom of the page I have a Total Fees field of all the classes. The member is supposed to pay this amount to our organization. Question: We decided to do an online payment this year and would like to calculate a 2% additional amount on the Total Fees. This amount is paid to the Payment Merchant site. We cannot afford to lose the 2% since we are a non profit. Would really appreciate if someone can tell me how to 1) Add a new field under the Total field 2) And calculate the 2% additional fees and do a Grand Total. Thanks in advance. Hi guys. I'm a mediocre website designer i know html , at JS i'm to noob to actualy make something of my own just Edit, i'm still learning and atm i'm working on a web project and I'm struggling to find a way to Filter email addresses to redirect my New Members to their e-mail provider, for example if they would register newmmember@hotmail.com to be forwarded to www.hotmail.com so they would login and activate their account, or if they enter @yahoo.com to be forwarded there . Can you please point out a few things i'm eager to learn how to Forward User to email provider after he creates his account . Or how can i forward email to URL inside my webpage , this could help me with another ideea i have, again this would have to be filtered @yahoo.com , @hotmail.com etc , to be forwarded to a local URL inside the site depending on what Email Provider they enter . I know this is a lot to ask but if you could point me out on the right path i would really appreciate all your help . Cheers
Hi, Im using the old nopcard scripts on my site. It does every thing right except it does not send a Email to my to my email adres. I dont know how to correct this because i dont know Javascript. I include the script if anybody know how to alter it so that it will send the info to my email adres as well. Thank you very much for your previous help. Kees Meyer Oudtshoorn South Africa. The checkout.pl script : #!/usr/bin/perl #=====================================================================|| # NOP Design JavaScript Shopping Cart || # PERL CGI Checkout Module || # || # For more information on SmartSystems, or how NOPDesign can help you || # Please visit us on the WWW at http://www.nopdesign.com || # || # Javascript portions of this shopping cart software are available as || # freeware from NOP Design. You must keep this comment unchanged in || # your code. For more information contact FreeCart@NopDesign.com. || # || # JavaScript Shop Module, V.4.4.0 || #=====================================================================|| # || # Function: Writes available form elements from the NOP || # Free Cart (http://www.nopdesign.com/freecart) || # and other form elements to an email file, and || # send user confirmation || # || #=====================================================================|| require 5.001; ######################################################################## # # # User defined variables: # # $header - string value containing the complete # # path of the HTML page header # # $footer - string value containing the complete # # path of the HTML page footer # # $mailprogram - string value containing the complete path to # # the sendmail binary on the system. # # $youremail - string value containing the email address to # # send catalog orders in EMAIL or BOTH modes # # **Don't forget to put a \ before the @ in your # # email address. ie. spam\@nopdesign.com*** # # $returnpage - URL to send user when checkout is complete # # $csvfilename - string value containing the complete # # path of the user database. # # $csvquote - string value containing what to use for quotes # # in the csv file (typically "" or \") # # $mode - string value containing 'EMAIL', 'FILE' or # # 'BOTH' to determine if the script should send # # an email to you with the new order, write the # # order to a CSV file, or do both. # ######################################################################## $header = "header.html"; $footer = "footer.html"; $mailprogram = "/usr/lib/sendmail -t"; $returnpage = "/"; $youremail = "support\@ebookstore.co.za"; $csvfilename = "orders.csv"; $csvquote = "\"\""; $mode = "BOTH"; #These are required fields. I recommend enforcing these by javascript, #but let's just make sure here as well. @required = ( 'b_first', 'b_last', 'b_addr', 'b_city', 'b_state', 'b_zip', 'b_phone', 'b_email' ); ############################################################## #FUNCTION: urlDecode # #RETURNS: The decoded string. # #PARAMETERS: An encoded string. # #PURPOSE: Decodes a URL encoded string. # ############################################################## sub urlDecode { my ($string) = @_; $string =~ tr/+/ /; $string =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg; $string =~ s/['"]/\'/g; return ($string); } ############################################################## #FUNCTION: processCGI # #RETURNS: # #PARAMETERS: # #PURPOSE: Retrieves form data submitted via the 'GET' # # method and decodes it. You may then access # # the passed in variables via calls to $[name] # # where [name] is the name of the form element. # ############################################################## sub processCGI { local ($cgiData, $key, $value, $pair, @pairs); if ($ENV{'REQUEST_METHOD'} eq 'GET') { $cgiData = $ENV{'QUERY_STRING'}; } else { $cgiData = <STDIN>; } @pairs = split (/&/, $cgiData); foreach $pair (@pairs) { ($key, $value) = split (/\=/, $pair); $key = &urlDecode($key); $value = &urlDecode($value); if(defined ${$key}){ ${$key} .= ", ".$value; }else{ ${$key} = $value; } } } ############################################################## #FUNCTION: doFormError # #RETURNS: # #PARAMETERS: A error message string. # #PURPOSE: Generates an HTML page indicating a form # # submission error occurred. # ############################################################## sub doFormError { my ($errString) = @_; open (HEAD, $header); @LINES = <HEAD>; close HEAD; print "Content-type: text/html\n\n"; print @LINES; print "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>"; print "$errString<BR><BR>\n"; print "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>"; open (FOOT, $footer); @LINES = <FOOT>; close FOOT; print @LINES; exit; } ############################################################## #FUNCTION: doError # #RETURNS: # #PARAMETERS: A error message string. # #PURPOSE: Generates an HTML page indicating an error # # occurred. # ############################################################## sub doError { my ($errString) = @_; print "Content-type: text/html\n\n"; open (HEAD, $header); @LINES = <HEAD>; close HEAD; print @LINES; print "$errString<BR><BR>\n"; open (FOOT, $footer); @LINES = <FOOT>; close FOOT; print @LINES; exit; } ############################################################## #FUNCTION: invalidE # #RETURNS: 1 if invalid, 0 if valid. # #PARAMETERS: An email address variable. # #PURPOSE: Checks to see if a submitted email address is # # of the valid form 'x@y'. # ############################################################## sub invalidE { my ($szEmail) = @_; my ($user, $host); $szEmail =~ tr/A-Z/a-z/; if ($szEmail =~ /\s/) { return 1; } ($user, $host) = split (/\@/, $szEmail); if ($host =~ /compuserve/i) { ; } else { if (! $user =~ /\D/) { return 1; } if (! $host =~ /\D/) { return 1; } if (substr ($user,0,1) !~ /[a-z]/) { return 1; } } if ($szEmail =~ /\w+\@[\w|\.]/) { return 0; } else { return 1; } } sub populateDateVar { (Taken out because Text to long for email) "===================================================================== \n"; print MAIL "$QUANTITY_1 \R$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n"; if( $NAME_2 ) {print MAIL "$QUANTITY_2 \R$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";} if( $NAME_3 ) {print MAIL "$QUANTITY_3 \R$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";} if( $NAME_4 ) {print MAIL "$QUANTITY_4 \R$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";} if( $NAME_5 ) {print MAIL "$QUANTITY_5 \R$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";} if( $NAME_6 ) {print MAIL "$QUANTITY_6 \R$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";} if( $NAME_7 ) {print MAIL "$QUANTITY_7 \R$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";} if( $NAME_8 ) {print MAIL "$QUANTITY_8 \R$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";} if( $NAME_9 ) {print MAIL "$QUANTITY_9 \R$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";} if( $NAME_10 ){print MAIL "$QUANTITY_10 \R$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";} if( $NAME_11 ){print MAIL "$QUANTITY_11 \R$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";} if( $NAME_12 ){print MAIL "$QUANTITY_12 \R$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";} if( $NAME_13 ){print MAIL "$QUANTITY_13 \R$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";} print MAIL "===================================================================== \n"; print MAIL "SUBTOTAL: $SUBTOTAL \n"; print MAIL "TOTAL: $TOTAL \n"; print MAIL "\n"; print MAIL "\n\n"; print MAIL "Comments: \n"; print MAIL "--------- \n"; print MAIL "$comment \n"; print MAIL " \n"; close MAIL; } if( $mode eq "BOTH" || $mode eq "FILE") { $csvcomments = $comment; #$csvcomments =~ s/\"/$csvquote/ig; open (CSVF,">>$csvfilename"); print CSVF "\""; print CSVF "$months[$month] $day, $year $hour:$min:$sec"; print CSVF "\",\""; print CSVF "$b_first"; print CSVF "\",\""; print CSVF "$b_last"; print CSVF "\",\""; print CSVF "$b_addr"; print CSVF "\",\""; print CSVF "$b_addr2"; print CSVF "\",\""; print CSVF "$b_city"; print CSVF "\",\""; print CSVF "$b_state"; print CSVF "\",\""; print CSVF "$b_zip"; print CSVF "\",\""; print CSVF "$b_phone"; print CSVF "\",\""; print CSVF "$b_fax"; print CSVF "\",\""; print CSVF "$b_email"; print CSVF "\",\""; print CSVF "$s_first"; print CSVF "\",\""; print CSVF "$s_last"; print CSVF "\",\""; print CSVF "$s_addr"; print CSVF "\",\""; print CSVF "$s_addr2"; print CSVF "\",\""; print CSVF "$s_city"; print CSVF "\",\""; print CSVF "$s_state"; print CSVF "\",\""; print CSVF "$s_zip"; print CSVF "\",\""; print CSVF "$s_phone"; print CSVF "\",\""; print CSVF "$QUANTITY_1"; print CSVF "\",\""; print CSVF "\R$PRICE_1"; print CSVF "\",\""; print CSVF "$ID_1"; print CSVF "\",\""; print CSVF "$NAME_1"; print CSVF "\",\""; print CSVF "$ADDTLINFO_1"; print CSVF "\",\""; print CSVF "$QUANTITY_2"; print CSVF "\",\""; print CSVF "\R$PRICE_2"; print CSVF "\",\""; print CSVF "$ID_2"; print CSVF "\",\""; print CSVF "$NAME_2"; print CSVF "\",\""; print CSVF "$ADDTLINFO_2"; print CSVF "\",\""; print CSVF "$QUANTITY_3"; print CSVF "\",\""; print CSVF "\R$PRICE_3"; print CSVF "\",\""; print CSVF "$ID_3"; print CSVF "\",\""; print CSVF "$NAME_3"; print CSVF "\",\""; print CSVF "$ADDTLINFO_3"; print CSVF "\",\""; print CSVF "$QUANTITY_4"; print CSVF "\",\""; print CSVF "\R$PRICE_4"; print CSVF "\",\""; print CSVF "$ID_4"; print CSVF "\",\""; print CSVF "$NAME_4"; print CSVF "\",\""; print CSVF "$ADDTLINFO_4"; print CSVF "\",\""; print CSVF "$QUANTITY_5"; print CSVF "\",\""; print CSVF "\R$PRICE_5"; print CSVF "\",\""; print CSVF "$ID_5"; print CSVF "\",\""; print CSVF "$NAME_5"; print CSVF "\",\""; print CSVF "$ADDTLINFO_5"; print CSVF "\",\""; print CSVF "$QUANTITY_6"; print CSVF "\",\""; print CSVF "\R$PRICE_6"; print CSVF "\",\""; print CSVF "$ID_6"; print CSVF "\",\""; print CSVF "$NAME_6"; print CSVF "\",\""; print CSVF "$ADDTLINFO_6"; print CSVF "\",\""; print CSVF "$QUANTITY_7"; print CSVF "\",\""; print CSVF "\R$PRICE_7"; print CSVF "\",\""; print CSVF "$ID_7"; print CSVF "\",\""; print CSVF "$NAME_7"; print CSVF "\",\""; print CSVF "$ADDTLINFO_7"; print CSVF "\",\""; print CSVF "$QUANTITY_8"; print CSVF "\",\""; print CSVF "\R$PRICE_8"; print CSVF "\",\""; print CSVF "$ID_8"; print CSVF "\",\""; print CSVF "$NAME_8"; print CSVF "\",\""; print CSVF "$ADDTLINFO_8"; print CSVF "\",\""; print CSVF "$QUANTITY_9"; print CSVF "\",\""; print CSVF "\R$PRICE_9"; print CSVF "\",\""; print CSVF "$ID_9"; print CSVF "\",\""; print CSVF "$NAME_9"; print CSVF "\",\""; print CSVF "$ADDTLINFO_9"; print CSVF "\",\""; print CSVF "$QUANTITY_10"; print CSVF "\",\""; print CSVF "\R$PRICE_10"; print CSVF "\",\""; print CSVF "$ID_10"; print CSVF "\",\""; print CSVF "$NAME_10"; print CSVF "\",\""; print CSVF "$ADDTLINFO_10"; print CSVF "\",\""; print CSVF "$QUANTITY_11"; print CSVF "\",\""; print CSVF "\R$PRICE_11"; print CSVF "\",\""; print CSVF "$ID_11"; print CSVF "\",\""; print CSVF "$NAME_11"; print CSVF "\",\""; print CSVF "$ADDTLINFO_11"; print CSVF "\",\""; print CSVF "$QUANTITY_12"; print CSVF "\",\""; print CSVF "\R$PRICE_12"; print CSVF "\",\""; print CSVF "$ID_12"; print CSVF "\",\""; print CSVF "$NAME_12"; print CSVF "\",\""; print CSVF "$ADDTLINFO_12"; print CSVF "\",\""; print CSVF "$QUANTITY_13"; print CSVF "\",\""; print CSVF "\R$PRICE_13"; print CSVF "\",\""; print CSVF "$ID_13"; print CSVF "\",\""; print CSVF "$NAME_13"; print CSVF "\",\""; print CSVF "$ADDTLINFO_13"; print CSVF "\",\""; print CSVF "$SUBTOTAL"; print CSVF "\",\""; print CSVF "$TOTAL"; print CSVF "\",\""; print CSVF "$SHIPPING"; print CSVF "\",\""; print CSVF "$comment"; print CSVF "\"\n"; close CSVF; } # Send email conformation to the customer..... open (MAIL,"|$mailprogram"); print MAIL "To: $b_email\n"; print MAIL "From: $youremail\n"; print MAIL "Subject: Order Confirmation\n"; print MAIL "\n\n"; print MAIL "A new order has been received. A summary of this order appears below.\n"; print MAIL "\n"; print MAIL "Order Date: $months[$month] $day, $year $hour:$min:$sec \n"; print MAIL " \n"; print MAIL "Bill To: \n"; print MAIL "-------- \n"; print MAIL " $b_first $b_last \n"; print MAIL " $b_addr \n"; print MAIL " $b_addr2 \n"; print MAIL " $b_city, $b_state $b_zip \n"; print MAIL " $b_phone \n"; print MAIL " $b_fax \n"; print MAIL " $b_email \n"; print MAIL " \n"; print MAIL " \n"; print MAIL "-------- \n"; if ( $s_addr eq "" ) { print MAIL " Use Billing Address\n"; } else { print MAIL " $s_first $s_last \n"; print MAIL " $s_addr \n"; print MAIL " $s_addr2 \n"; print MAIL " $s_city, $s_state $s_zip \n"; print MAIL " $s_phone \n"; } print MAIL " \n"; print MAIL " \n"; print MAIL "Qty Price(\R) Product ID - Product Name\n"; print MAIL "===================================================================== \n"; print MAIL "$QUANTITY_1 \R$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n"; if( $NAME_2 ) {print MAIL "$QUANTITY_2 \R$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";} if( $NAME_3 ) {print MAIL "$QUANTITY_3 \R$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";} if( $NAME_4 ) {print MAIL "$QUANTITY_4 \R$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";} if( $NAME_5 ) {print MAIL "$QUANTITY_5 \R$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";} if( $NAME_6 ) {print MAIL "$QUANTITY_6 \R$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";} if( $NAME_7 ) {print MAIL "$QUANTITY_7 \R$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";} if( $NAME_8 ) {print MAIL "$QUANTITY_8 \R$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";} if( $NAME_9 ) {print MAIL "$QUANTITY_9 \R$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";} if( $NAME_10 ){print MAIL "$QUANTITY_10 \R$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";} if( $NAME_11 ){print MAIL "$QUANTITY_11 \R$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";} if( $NAME_12 ){print MAIL "$QUANTITY_12 \R$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";} if( $NAME_13 ){print MAIL "$QUANTITY_13 \R$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";} print MAIL "===================================================================== \n"; print MAIL "SUBTOTAL: $SUBTOTAL \n"; print MAIL "TOTAL: $TOTAL \n"; print MAIL "\n"; print MAIL "\n\n"; print MAIL "Comments: \n"; print MAIL "--------- \n"; print MAIL "$comment \n"; print MAIL " \n"; close MAIL; print "Content-type: text/html\n\n"; open (HEAD, $header); @LINES = <HEAD>; close HEAD; print @LINES; print "<h2>Thank you</h2>"; print "Thank you for your order."; print "Please contact us at $youremail if you have any problems questions or concerns. Thank U again for your support Kees Meyer."; print "<P>"; print "<A HREF=\"$returnpage\" rel="nofollow" target=_top>Return Home</A>"; print "<P>"; open (FOOT, $footer); @LINES = <FOOT>; close FOOT; print @LINES; exit; Is there a way to disable a SINGLE script on the page, something that a user can click and it disables only the script choosen? Thanks, Latchy I have a website that contains a large div inside a smaller div, only to be scrolled via javascript. The problem is when you mouseover the smaller (container) div and you scroll the mousewheel down, everything scrolls down. I've been searching for a while and haven't got any answers. www.designbyryanboog.com/spa (site only works in IE8, Chrome, Safari, Opera, Firefox<slowly>) Thanks in advance Hello, I have been looking for a good walk-through online, but can't seem to find an exact resolution to what I am trying to do. Can someone please supply some example code for not displaying everything that is inside a <div>. Basically I do not want social media content to be displayed on secure pages, but want them on every other page. This is what I have: Code: <div id="share"> <ul> <li> <div class="addthis_toolbox addthis_default_style "> <a href="http://www.addthis.com/bookmark.php?v=250&username=###### class="addthis_button_compact">Share</a> <span class="addthis_separator">|</span> <a class="addthis_button_preferred_1"></a> <a class="addthis_button_preferred_2"></a> <a class="addthis_button_preferred_3"></a> <a class="addthis_button_preferred_4"></a> </div> </li> <script> var addthis_config = {"data_track_clickback":true}; if (document.location.protocol !== 'https:') { $jq.getScript('http://s7.addthis.com/js/250/addthis_widget.js?username=######', function() { }); } </script> </ul> </div> |