Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Location
    Upstate, NY
    Posts
    40
    Plugin Contributions
    0

    help question Link not working..

    I need a rubber ducky to bounce my problem off...any takers?

    I've created a custom form for people to fill out.
    Form

    The actual code for the form:
    Code:
    <script language='javascript'>
    function verifyMe(){
    var msg='';
    
    if(document.getElementById('name').value==''){
    	msg+='- Name\n\n';}
    
    var email=document.getElementById('email_address').value;
    if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))){
    msg+='- Invalid Email Address: '+email+'\n\n';}
    
    if(document.getElementById('email_address').value==''){
    	msg+='- Email Address\n\n';}
    
    if(document.getElementById('important').value==''){
    	msg+='- What\'s important to you when it comes to buying jewelry\n\n';}
    
    if(document.getElementById('last_purchase').value==''){
    	msg+='- When was the last time you purchased jewelry\n\n';}
    
    if(document.getElementById('other_locations').value==''){
    	msg+='- Do you purchase jewelry online or at other locations\n\n';}
    
    if(document.getElementById('jewelry_like').value==''){
    	msg+='- What type of jewelry do you like: rings, pins, necklace, chain, etc\n\n';}
    
    if(document.getElementById('color_preference').value==''){
    	msg+='- Do you have a color preference, i.e. Gold, Silver or Two-tone\n\n';}
    
    if(document.getElementById('pieces_owned').value==''){
    	msg+='- How many pieces of jewelry do you own\n\n';}
    
    if(document.getElementById('gifts').value==''){
    	msg+='- Do you give jewelry as gifts  \n\n';}
    
    if(document.getElementById('favorite_church').value==''){
    	msg+='- Do you have a favorite Church or Not-for-Profit that you support \n\n';}
    
    if(document.getElementById('birthstone_color').value==''){
    	msg+='- What is your Birthstone color\n\n';}
    
    if(document.getElementById('interest').value==''){
    	msg+='- What range of jewelry interest you\n\n';}
    
    if(document.getElementById('hidden').value==''){
    	msg+='- \n\n';}
    
    if(msg!=''){
    	alert('The following fields are empty or invalid:\n\n'+msg);
    	return false
    }else{
    	return true }
    
    }
    </script>
    <form name='project-hope' action='Survey' method='POST' action='store/contact/mailer.php' enctype='application/x-www-form-urlencoded' onsubmit='return verifyMe();'><input type='hidden' name='hidden' id='hidden' value=''>
    <table class='table_form_1' id='table_form_1' cellspacing='0' width="499">
    	<tr>
    		<td class='ftbl_row_1' width="500" ><b style='color:red'>*</b>Name
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >
    		<input type='text' name='name' id='name' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" ><b style='color:red'>*</b>Email Address
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >
    		<input type='text' name='email_address' id='email_address' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" ><b style='color:red'>*</b>What's important to you when it comes to buying jewelry
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >
    		<input type='text' name='important' id='important' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" ><b style='color:red'>*</b>When was the last time you purchased jewelry
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >
    		<input type='text' name='last_purchase' id='last_purchase' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" ><b style='color:red'>*</b>Do you purchase jewelry online or at other locations
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >
    		<input type='text' name='other_locations' id='other_locations' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" ><b style='color:red'>*</b>What type of jewelry do you like: rings, pins, necklace, chain, etc
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >
    		<input type='text' name='jewelry_like' id='jewelry_like' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" ><b style='color:red'>*</b>Do you have a color preference, i.e. Gold, Silver or Two-tone
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >
    		<input type='text' name='color_preference' id='color_preference' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" ><b style='color:red'>*</b>How many pieces of jewelry do you own
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >
    		<input type='text' name='pieces_owned' id='pieces_owned' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" ><b style='color:red'>*</b>Do you give jewelry as gifts  
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >
    		<input type='text' name='gifts' id='gifts' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" ><b style='color:red'>*</b>Do you have a favorite Church or Not-for-Profit that you support 
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >
    		<input type='text' name='favorite_church' id='favorite_church' size='57' value=''></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_1' width="500" ><b style='color:red'>*</b>What is your Birthstone color
    		</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" ><select name='birthstone_color' id='birthstone_color'>
    			<option value='Garnet'>Garnet</option>
    			<option value=' Amethyst'> Amethyst</option>
    			<option value=' Aquamarine'> Aquamarine</option>
    			<option value=' White Topaz'> White Topaz</option>
    			<option value=' Emerald'> Emerald</option>
    			<option value=' Pearl'> Pearl</option>
    			<option value=' Ruby'> Ruby</option>
    			<option value=' Peridot'> Peridot</option>
    			<option value=' Sapphire'> Sapphire</option>
    			<option value=' Tourmaline'> Tourmaline</option>
    			<option value=' Citrine'> Citrine</option>
    			<option value=' Blue Topaz'> Blue Topaz</option>
    		</select></td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" >&nbsp;</td>
    	</tr>
    	<tr>
    		<td class='ftbl_row_2' width="500" ><b style='color:red'>*</b>What range of jewelry interest you
    		</td>
    	</tr>
    	<tr>
    		<td align='right' width="500">
    		<p align="left"><select name='interest' id='interest'>
    			<option value='Costume'>Costume</option>
    			<option value=' Mid-Range'> Mid-Range</option>
    			<option value=' Fine'> Fine</option>
    		</select></td>
    	</tr>
    	<tr>
    		<td align='left'>&nbsp;</td>
    	</tr>
    	<tr>
    		<td align='left'><input type='submit' name='submit' value='Submit'>&nbsp;<input type='reset' name='reset' value='Reset'><br />
    		</td>
    	</tr>
    </table>
    </form>
    The file that it calls is mailer.php
    Code for that file is:
    Code:
    <?php
    if(isset($_POST['submit'])) {
    
    $to = "cornickjj######################";
    $subject = "Survey Submission";
    $name_field = $_POST['name'];
    $email_field = $_POST['email_address'];
    $important = $_POST['important'];
    $last_purchase = $_POST['last_purchase'];
    $other_locations = $_POST['other_locations'];
    $jewelry_like = $_POST['jewelry_like'];
    $color_preference = $_POST['color_preference'];
    $pieces_owned = $_POST['pieces_owned'];
    $gifts = $_POST['gifts'];
    $favorite_church = $_POST['favorite_church'];
    $birthstone_color = $_POST['birthstone_color'];
    $interest = $_POST['interest'];
     
    $body = "From: $name_field\n 
    E-Mail: $email_field\n 
    Survey:\n
    What's important to you when it comes to buying jewelry: $important\n
    When was the last time you purchased jewelry: $last_purchase\n
    Do you purchase jewelry online or at other locations: $other_locations\n
    What type of jewelry do you like: $jewelry_like\n
    Do you have a color preference: $color_preference\n
    How many pieces of jewelry do you own: $pieces_owned\n
    Do you give jewelry as gifts: $gifts\n
    Do you have a favorite Church or Not-for-Profit: $favorite_church\n
    Birthstone color: $birthstone_color\n
    What range of jewelry interest: $interest";
     
    echo "Thank you for taking time to fill out the quick survey prepared for you.";
    mail($to, $subject, $body);
    
    } else {
    
    echo "Uh-oh...something is broken!";
    
    }
    ?>
    When I fill out my form I get a page can't be found.
    It's going to this url:
    http://www.project-hope.info/store/mailer.php

    When it should be going to this url
    http://www.project-hope.info/store/contact/mailer.php

    I thought I had it set properly...but apparently not.

    Any ideas? It's probably not that complicated, I just can't figure it out.

  2. #2
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: Link not working..

    first , this not the way you add javascript to zencart..
    you have two action set for your form , you only need one.

    how your mailer.php will going to send mail.. because i see nothing about server setup .

  3. #3
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Link not working..

    You could use the pre-made example here for collecting and emailing certain information: http://www.zen-cart.com/forum/showth...482#post386482
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jan 2009
    Location
    Upstate, NY
    Posts
    40
    Plugin Contributions
    0

    Default Re: Link not working..

    Quote Originally Posted by tony_sar View Post
    you have two action set for your form , you only need one.
    That was my problem, you found it! Sometimes it just takes another set of eyes...or a rubber ducky to bounce things off of.

    Now it works perfectly!

 

 

Similar Threads

  1. Link Not Working?
    By coxdabd in forum General Questions
    Replies: 1
    Last Post: 8 Nov 2010, 02:13 PM
  2. Contact us link not working
    By CaroleAs in forum General Questions
    Replies: 14
    Last Post: 15 Feb 2009, 11:14 PM
  3. "larger image" link & thumbnail link not working
    By tracyselena in forum General Questions
    Replies: 1
    Last Post: 7 Nov 2007, 08:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg