View Single Post
  #1 (permalink)  
Old Jul 26th, 2007, 09:06
mihirc mihirc is offline
New Member
Join Date: Jul 2007
Location: Pune, Maharashtra, India
Age: 20
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Question Problem: onClick Function

Hello All,
My first post in this forum.

I have made a general contact us module based in html/and table for Joomla. I have added verification and CAPTCHA. but the problem i am facing is that, for the submit button i need to give a 3 commands to make them work properly, i.e. unless the person has entered the cumpolsary fields he wont be able to send the mail. But the problem is the onclick command is parsing only the first of the attributes.

Here is the php code.

Code: Select all
input[type="text"] {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
background-image: url('images/input_bg.png');
background-repeat: no-repeat;
border: 1px solid #999999;
margin: 5px 0 0 0;
padding: 3px 3px 3px 3px;
display: inline;
}
textarea {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
background-image: url('images/input_bg.png');
background-repeat: no-repeat;
border: 1px solid #999999;
margin: 5px 0 0 0;
padding: 3px 3px 3px 3px;
display: inline;
}

* {
font-family: Arial;
font-size: 12px;
}
</style>
<div id="main">

<form method="POST" name="mailform">
  <table border="0">
    
    <tr>
      <td colspan="2"><strong>Send us an Enquiry</strong></td>
      </tr>
      
    <tr>
      <td>Your Name<br />
      <input type="text" name="name" id="name" class="from" size="<?php echo $width ?>"></td>
    </tr>
    
    <tr>
      <td>Company<br />
      <input name="company" type="text" class="from" id="companyname" size="<?php echo $company ?>"></td>
    </tr>
    
    <tr>
      <td>Email:<br />
      <input type="text" name="from" id="from" class="from" size="<?php echo $sendmail ?>"></td>
    </tr>
    
    <tr>
      <td>Phone<br />
      <input type="text" name="phone" id="phone" class="from" size="<?php echo $phone ?>"></td>
    </tr>
    
    <tr>
      <td>Fax<br />
      <input type="text" name="fax" id="fax" class="from" size="<?php echo $fax ?>"></td>
    </tr>
    
    <tr>
      <td>Subject:<br />
      <input type="text" name="subject" id="subject" class="subject" size="<?php echo $subject ?>"></td>
    </tr>
    
    <tr>
      <td>Mesage:<br />
      <textarea name="body" id="body" class="body" rows="<?php echo $messageh ?>" columns="<?php echo $messagew ?>"></textarea><br />
      <img src="modules/contactform/captcha.php?.png" alt="CAPTCHA" style="margin-top:4px;" /> <br />
          <input type="text" name="captchastring" size="6" /> (Case Sensitive!)</td> 
    </tr>
    
    <tr>
      <td colspan="2">  
          <input type="hidden" name="toaddress" value="<?php echo $to; ?>" id="toaddress">
          <input name="button" type="button" id="submit" value="Send Enquiry" onclick="return checkForm(); mailIt(this.form); document.mailform.captchastring.value='';">
  <input name="reset" type="reset" value="Reset">
             </td>
             
             </tr>
             </table>
</form>
</div>
<div id="status"></div>
THanking You,
mihir.
Reply With Quote