Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question with Javascript Emailing

    Hello everyone, I have a question regarding the following code. What does

    a href="javascript:mailsent();

    do? I am completely new to web design!

    I am trying to create a contact form and found one I liked at http://www.moozedesign.com/

    But I am confused about how it works. From most tutorials online, they use PHP and this one doesn't seem to.

    Code:
    		
    
    <div id="contForm">
    			<div id="fDiv"><form method="POST" name="form1">
    				<ul>
    					<li><input type="text" class="input-main" 
    name="Name" /></li>
    					<li><input type="text" class="input-main" name="Company" /></li>
    					<li><input type="text" class="input-main" name="Email" /></li>
    					<li><input type="text" class="input-main" name="Mobile" /></li>
    					<li class="forTA"><textarea class="textarea-main" cols="100" rows="3" name="Comments"></textarea></li>
    				</ul></form>
    			</div>
    			<div style="clear:both"></div>
    			<div id="subForm"><a href="javascript:mailsent();"></a></div>
    						<div style="clear:right"></div>
    		</div>

    Here are the fDiv css which contains the text boxes to fill out

    Code:
    #fDiv{
    	width:670px;
    	margin-top:5px;
    	float:right;
    	background:url(../images/form_bg.png) top left no-repeat;
    }
    
    #fDiv ul{
    	padding-left:140px;
    	padding-top:20px;
    	list-style:none;
    }
    
    #fDiv ul li{
    	width:465px;
    	text-align:center
    }
    
    #fDiv ul li .input-main{
    	background:url(../images/input_n.png) center no-repeat;
    	padding-left:18px;
    	padding-right:18px;
    	height:46px;
    	width:440px;
    	border:none;
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:12px;
    	line-height:40px;
    }
    
    #fDiv ul li .input-main-h{
    	background:url(../images/input_o.png) center no-repeat;
    	padding-left:18px;
    	padding-right:18px;
    	height:46px;
    	width:440px;
    	border:none;
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:12px;
    	line-height:40px;
    }
    
    .forTA{
    	height:100px;
    	width:465px;
    	padding-left:7px;
    	padding-right:18px;
    	padding-top:10px;
    	background:url(../images/textarea_n.png) no-repeat scroll 7px 0 transparent;
    	
    }
    
    .forhTA{
    	height:100px;
    	width:465px;
    	padding-left:7px;
    	padding-right:18px;
    	padding-top:10px;
    	background:url(../images/textarea_o.png) no-repeat scroll 7px 0 transparent;
    	
    }
    
    #fDiv ul li .textarea-main{
    	
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:12px;
    	background-color:transparent;
    	line-height:18px;
    	height:76px;
    	width:440px;
    	border:none;
    	overflow:hidden;
    	padding:0px;
    }
    
    #fDiv ul li .textarea-main-h{
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:12px;
    	background-color:transparent;
    	line-height:18px;
    	height:76px;
    	width:440px;
    	border:none;
    	overflow:hidden;
    	padding:0px;
    }


    Here is the subForm css which contains the image for the submit button

    Code:
    #subForm{
    	background:url(../images/submitBtn.png) top left no-repeat;
    	width:100px;
    	height:30px;
    	display:block;
    	float:right;
    	margin-right:60px;
    	margin-bottom:40px;
    
    }

    Thank you very much for your help!

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,791
    Thanks
    8
    Thanked 131 Times in 129 Posts
    the function they use:

    Code:
    function mailsent() {
    document.form1.action="index.php?act=sent#mContact";
    document.form1.submit();
    }
    so the form submits to the same page, tosses in a variable and a jump link back to the form.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis


  •  

    Posting Permissions

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