Link to home
Start Free TrialLog in
Avatar of RadhikaVyas
RadhikaVyasFlag for India

asked on

onclientclick not working

Hi
I have a problem while calling client side function on button click..Its working fine in my local system but not wrkng in server...I used set of radio buttons with name 'credrad' inside one form by name 'frmMain'..i Wrote some radiobutton validation in javascript..When I update my files to ftp its not executing that validation function only..Its throwing some error...
'document.frmMain.credrad' is null or not an object
why is it so in server...Below is my javascript function


if((document.frmMain.credrad[0].checked=="")&&(document.frmMain.credrad[1].checked=="")&&(document.frmMain.credrad[2].checked=="")&&(document.frmMain.credrad[3].checked==""))
     {
    alert ('Select Your Credit Card');
     return false;
     }
Avatar of sivagnanam chandrakanth
sivagnanam chandrakanth
Flag of India image

check whether you have uploaded all the files you have made changes, more imporantly the file which has this form

Also check whether credrad radio has 4 values to be referenced from JS. for example if you only 2 values for your radio button and refered document.frmMain.credrad[2].checked and document.frmMain.credrad[3].checked in JS, then you would get this error

Also on submit pass form example onclick="functionname(this.form)";

If everything is ok, try clearing the cache in your browser.

  document.frmMain.credrad[0].checked
Avatar of ragural
ragural

Make sure you have this code after your <form> HTML code in an inline javascript or in body onload event.

Looks like, your javascript is getting executed before the form is actually rendered on the page.
Avatar of RadhikaVyas

ASKER

Hi Everybody thanks for ur reply...
Actually it was working fine previously even its working fine in my local system..I dont know recently they shifted all files to some other system whose IIS is also latest one...So after shifting to new server it's not working now...pls help...
Avatar of Tom Beck
1.) I would try a different approach with different syntax for accessing the radio buttons. It's just a hunch but maybe accessing the radio buttons with document.frmMain.credrad[0] is the issue.

2.)
document.frmMain.credrad[0].checked==""

Open in new window

seems like a strange statement to me anyway. A radio button's checked value would never resolve to an empty string. It's either true or false.
if((!document.frmMain.credrad[0].checked)&&(!document.frmMain.credrad[1].checked)&&(!document.frmMain.credrad[2].checked)&&(!document.frmMain.credrad[3].checked))

Open in new window


3.) How about this inside your validation function instead:

   
var btns = document.getElementByName("credrad");
   for (var i=0; el=btns[i]; i++) {
     if (el.checked) return true;
   }
   alert('Select Your Credit Card');
   return false;

Open in new window

When shifting files around they often get changed particularly with FTP.

If you are testing the buttons in IE, make sure that you have script error reporting and debugging switched on under the Options menu. Often an error is reported (of not reported) on page load, then nothing works.

If that doesn't help, please post the entire page here.
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default3.aspx.cs" Inherits="_Default" enableeventvalidation="false"  ViewStateEncryptionMode ="Never" enableViewStateMac="false"%>
<!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>
<title>Houston MRI Diagnostic Radiology Of Houston</title>
<meta name="description" content="Since 1997, the Radiologists at Houston MRI – Diagnostic Radiology of Houston have been providing excellent diagnostic imaging tests in the Houston area." />
<meta name="keywords" content="Houston MRI Diagnostic Radiology Of Houston, Magnetic Resonance Imaging, Magnetic Resonance Angiography, Computed Radiography, Ultrasound, Bone Mass Density (DEXA), Body Mass Composition, Computed Tomography." />
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/menu.css" rel="stylesheet" type="text/css" />
<link rel="SHORTCUT ICON" href="../favicon.ico" type="image/x-icon" />
<script type='text/javascript' src='../jsfiles/min.js'></script>
<script type='text/javascript' src='../jsfiles/functions.js'></script>
<script type="text/javascript" src="../jsfiles/flash-fix.js"></script>
<!--<script type="text/javascript" src="../jsfiles/scrolltopcontrol.js"></script>-->

<link type="text/css" rel="Stylesheet" href="style.css" />
    <script type="text/javascript" src="script.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div style="background:url(../images/fotter-bg-s.gif) repeat-x bottom;">
  <table width="1004" align="center" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="128" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="50%" height="128" valign="top"><a href="../index.html"><img src="../images/houston-mri-logo.jpg" alt="Houston MRI - Diagnostic Radiology Of Houston" width="392" height="99" border="0" style="margin:17px 0px 0px 12px;" /></a></td>
            <td width="50%" valign="bottom"><a href="../appointment-houston-mri.html"><img src="../images/call-for-appointments-houston-mri.jpg" alt="Houston MRI - Diagnostic Radiology Of Houston: (713) 425-8100" width="221" height="50" border="0" align="right" style="margin:0px 11px 8px 0px;" /></a></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td height="56" valign="top" style="background:url(../images/menu-bg.gif) no-repeat left top;"><ul id="menu" style="margin:13px 0px 0px 12px;">
          <li>
            <div class="menu-home"><a href="../index.html">&nbsp;</a></div>
          </li>
          <!--<li>
            <div class="menu-about-us"><a href="javascript:void(0);">&nbsp;</a></div>
            <ul>
              <li style="border-top:1px solid #213d74;"><a href="houston-mri.html" style="width:140px;">:: Houston MRI</a></li>               
            
              <li><a href="locations-and-maps-houston-mri.html" style="width:140px;">:: Locations</a></li>
              <li><a href="contact-us-houston-mri.html" style="width:140px;">:: Contact Us</a></li>
            </ul>
          </li> -->
          <li>
            <div class="menu-services"><a href="../services-houston-mri.html">&nbsp;</a></div>
            <ul>
              <li style="border-top:1px solid #213d74;"><a href="../magnetic-resonance-imaging-houston-mri.html" style="width:250px;">:: MRI (Magnetic Resonance Imaging)</a></li>
              <li><a href="../magnetic-resonance-angiography-houston-mri.html" style="width:250px;">:: MRA (Magnetic Resonance Angiography)</a></li>
              <li><a href="../x-ray-houston-mri.html" style="width:250px;">:: Digital X-Ray (Computed Radiogaphy)</a></li>
              <li><a href="../ultrasound-houston-mri.html" style="width:250px;">:: Ultrasound</a></li>
              <li><a href="../bone-density-testing-houston-mri.html" style="width:250px;">:: Bone Mass Density (DEXA)</a></li>
               <li><a href="../body-mass-composition-houston-mri.html" style="width:250px;">:: Body Mass Composition (BMC)</a></li>
              <li><a href="../computed-tomography-houston-mri.html" style="width:250px;">:: Computed Tomography (CT)</a></li>
              </ul></li>
          <li>
            <div class="menu-for-patients"><a href="../patients-houston-mri.html">&nbsp;</a></div>
            <ul>
              <li style="border-top:1px solid #213d74;"><a href="../patients-houston-mri.html" style="width:150px;">:: Patients</a></li>
              <li><a href="../appointment-houston-mri.html" style="width:150px;">:: Appointment</a></li>
              <li><a href="../insurance-plans-houston-mri.html" style="width:150px;">:: Insurance Plans</a></li>
              <li><a href="../patient-forms-houston-mri.html" style="width:150px;">:: Patient Forms</a></li>
              <li><a href="../your-procedure-houston-mri.html" style="width:150px;">:: About Your Procedure</a></li>
              <li><a href="../pay-online-houston-mri.html" style="width:150px;">:: Pay Online</a></li>
            </ul>
          </li>
          <li>
            <div class="menu-for-physicians"><a href="../for-physicians-houston-mri.html">&nbsp;</a></div>
            <ul>
              
              <li style="border-top:1px solid #213d74;"><a href="../order-forms-houston-mri.html" style="width:179px;">:: Order Forms</a></li>
              <li><a href="http://drhmri.smaartnet.com/webpacs/login.jsp" target="_blank" style="width:179px;">:: View Images</a></li>
              <li><a href="https://doctors.drhmri.com/" target="_blank" style="width:179px;">:: View Reports</a></li>
             <!-- <li><a href="teaching-files-houston-mri.html" style="width:140px;">:: Teaching Files</a></li>-->
              <!--<li><a href="continuing-education-houston-mri.html" style="width:140px;">:: Continuing Education</a></li> -->
              <li><a href="../our-radiologists-houston-mri.html" style="width:179px;">:: Our Radiologists</a></li>
            </ul>
          </li>
          
          <li>
            <div class="menu-contact-us"><a href="../contact-us-landing-houston-mri.html">&nbsp;</a></div>
            <ul>
            <li style="border-top:1px solid #213d74;"><a href="../contact-us-houston-mri.html"  style="width:160px;">:: Contact Us</a></li>
              <li><a href="../locations-and-maps-houston-mri.html" style="width:160px;">:: Locations and Maps</a></li>
              <li><a href="../join-our-team-houston-mri.html" style="width:160px;" class="subMenu">:: Join Our Team</a>
              <ul style="margin-left:-40px;">
              <li style="border-top:1px solid #213d74;"><a href="../employment-houston-mri.html" style="width:160px;">:: Employment</a></li>
              <li><a href="../benefits-houston-mri.html" style="width:160px;">:: Benefits</a></li>
              <li><a href="../faq-houston-mri.html" style="width:160px;">:: FAQs </a></li>
            </ul>
               </li>
            </ul>
          </li>
          <li><div class="menu-testimonial"><a href="../testimonial-houston-mri.html">&nbsp;</a></div></li>
          
          <li>
            <div class="menu-employee-portal"><a href="../employee-login.php">&nbsp;</a></div></li>
<!--          <li>
            <div class="menu-faq"><a href="javascript:void(0);">&nbsp;</a></div><ul>
              <li style="border-top:1px solid #213d74;"><a href="magnetic-resonance-imaging-faq-houston-mri.html" style="width:150px;">:: MRI</a> </li>
              <li><a href="magnetic-resonance-angiography-faq-houston-mri.html" style="width:150px;">:: MRA</a></li>
              <li><a href="x-ray-faq-houston-mri.html" style="width:150px;">:: X-Ray </a></li>
              <li><a href="ultrasound-faq-houston-mri.html" style="width:150px;">:: Ultrasound</a></li>
              <li><a href="bone-density-testing-faq-houston-mri.html" style="width:150px;">:: Bone Density - DEXA</a></li>
              <li><a href="body-mass-composition-faq-houston-mri.html" style="width:150px;">:: Body Mass Composition</a></li>
            </ul>
          </li>
-->        </ul></td>
    </tr>
    <tr>
      <td height="220" valign="top" style="background:url(../images/flash-bg.jpg) no-repeat left top;">
      <iframe height="220" width="1004" frameborder="0" scrolling="no" allowtransparency="true" src="../flash.html"></iframe>
      </td>
    </tr>
    <tr>
      <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="711" valign="top" style="background:url(../images/hr-line.gif) no-repeat 15px 73px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="45" valign="top"><div class="navigation"><a href="../index.html">Home</a> &raquo; <a href="../for-patients-houston-mri.html">For Patients</a> &raquo; Pay Online</div></td>
                </tr>
                <tr>
                  <td height="26" valign="top" class="MainHeading">Pay Safely Online</td>
                </tr>
                <tr>
                  <td class="textMain" valign="top"><p>Thank you for choosing <span class="textMainBold">Houston MRI - Diagnostic Radiology of Houston</span> to assist your doctor in your health care.  For your convenience, we have online payment options for our patients.  This is a secured internet site in compliance with HIPAA and all banking regulations. Your personal information is not stored after your payment is processed. Houston MRI does not and will not share any of your information. </p>
                    <p>Please use the statement header below as a reference. Please review for accuracy. Press the Submit payment button only once when finished. This may take up to 3 minutes to process depending on your internet connection. </p>
                    <p><img src="../images/pay-online-statement.jpg" width="831" height="343" alt="payonline" border="0" class="tableborder" /></p>
                    <p>&nbsp;</p>
                    
                    
    <form id="frmMain" runat="server">
    <div id="ccForm">
        <table cellpadding="0" cellspacing="0" class="tableborder">
            <tbody>
              <tr>
                <td colspan="3" class="formHead">Payment Information</td>
                </tr>
              <tr>
                <td height="5" colspan="3" valign="top"></td>
              </tr>
              <tr>
                <td height="50" colspan="3" valign="top"><table width="100%" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="20%" class="formlable">Patient Account Number</td>
                    <td width="10%"><asp:TextBox CssClass="txtfield1" ID="txtPatientNum" MaxLength="7" runat="server" Width="55" TabIndex="1" onKeyup="next('txtPatientNum','7','Tbpay')" onkeypress="return isNumberKey(event)"></asp:TextBox></td>
                    <td width="19%" class="smallInfo"><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="txtPatientNum" ErrorMessage="* Required"></asp:RequiredFieldValidator>
                      <br />
                      <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                            ControlToValidate="txtPatientNum" ErrorMessage="* Please check your entry" 
                            ValidationExpression="\d+"></asp:RegularExpressionValidator></td>
                    <td width="15%" class="formlable">Payment Amount</td>
                    <td width="15%" class="smallInfo"> <span class="smallInfo">$</span>
                  <asp:TextBox Columns="7" CssClass="txtfield1" ID="txtPayment" runat="server" style="display:none"></asp:TextBox>
                  <asp:TextBox  CssClass="txtfield1" ID="Tbpay" runat="server"  onkeydown="return NumericTextBox(event)" Width="5em" TabIndex="2"></asp:TextBox>
                  <span class="textMainBold">.</span>
                  <asp:TextBox  CssClass="txtfield1" ID="Tbpam" runat="server"  onkeydown="return NumericTextBox(event)" MaxLength="2" Width="2em" onKeyup="onClickSum()" TabIndex="3"></asp:TextBox></td>
                    <td width="21%" class="smallInfo"><asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" 
                            ControlToValidate="Tbpay" ErrorMessage="* Amount Required"></asp:RequiredFieldValidator></td>
                    
                  </tr>
                </table></td>
                </tr>
				                     
		 
              <tr>
                <td width="203" height="50" valign="top" class="formlable">Patient Name</td>
                <td valign="top">
                  <table width="100%" cellpadding="0" cellspacing="0" class="smallInfo" style="width: 100%">
                    <tr>
                      <td>First</td>
                      <td>Last</td></tr>
                    <tr><td><asp:TextBox Columns="20" CssClass="txtfield1" ID="txtFirstName" runat="server" TabIndex="4"></asp:TextBox></td><td>
                      <asp:TextBox Columns="20" CssClass="txtfield1" ID="txtLastName" runat="server" TabIndex="5"></asp:TextBox></td></tr>
                    </table>
                  </td>
                <td valign="top" class="smallInfo">
                  <br />
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ErrorMessage="* Required First Name" ControlToValidate="txtFirstName"></asp:RequiredFieldValidator> 
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                            ErrorMessage="* Required Last name" ControlToValidate="txtLastName"></asp:RequiredFieldValidator>    
                </td></tr>
              <tr>
                <td height="30" valign="top" class="formlable">Email Address</td>
                <td valign="top">
                  <asp:TextBox Columns="48" CssClass="txtfield1" ID="txtEmail" runat="server" TabIndex="6"></asp:TextBox>
                  </td>
                <td valign="top" class="smallInfo"><asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" 
                            ControlToValidate="txtEmail" ErrorMessage="* Email Required"></asp:RequiredFieldValidator> 
                  <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                            ControlToValidate="txtEmail" ErrorMessage="* Please check your entry"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                  </td>
              </tr>
              <tr>
                <td height="30" valign="top" class="formlable">Primary Phone Number</td>
                <td valign="top">
                  <asp:TextBox  CssClass="txtfield1" ID="TextBox1" runat="server"  onkeypress="return isNumberKey(event)" Width="2em" onKeyup="next('TextBox1','3','TextBox2')" TabIndex="7"></asp:TextBox>
                  <asp:TextBox  CssClass="txtfield1" ID="TextBox2" runat="server"  onkeypress="return isNumberKey(event)" Width="2em" onKeyup="next('TextBox2','3','TextBox3')" TabIndex="8"></asp:TextBox>
                  <asp:TextBox  CssClass="txtfield1" ID="TextBox3" MaxLength="4" runat="server" onkeypress="return isNumberKey(event)" Width="3em" onKeyup="onClickSum()"  TabIndex="9"></asp:TextBox>
                </td>
                <td width="305" valign="top" class="smallInfo"><asp:TextBox Columns="10" CssClass="txtfield1" ID="txtPhone" style="display:none" runat="server"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="TextBox1" ErrorMessage="* Phone Required"></asp:RequiredFieldValidator></td>
              </tr>
                      
                <tr><td colspan="3">
                  
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td colspan="6" class="formHead">Credit Card Information</td>
                      </tr>
                    <tr>
                      <td colspan="6" align="center">&nbsp;</td>
                      </tr>
                    <tr>
                      <td width="207" align="center">&nbsp;</td>
                      <td width="80" align="center"><img id="Img1" src="~/images/visa.jpeg" runat="server"  alt="pay-online-card"/></td>
                      <td width="80" align="center"><img id="Img2" src="~/images/icon-amex.png" runat="server"  border="0" class="tableborder" alt="amex"/></td>
                      <td width="80" align="center"><img id="Img3" src="~/images/discover.png" runat="server"  border="0" class="tableborder" alt="discover"/></td>
                      <td width="80" align="center"><img id="Img4" src="~/images/master.jpeg" runat="server"  border="0" class="tableborder" alt="discover"/></td>
                      <td width="380" align="center">&nbsp;</td>
                      </tr>
                    <tr>
                      <td width="207" align="center">&nbsp;</td>
                      <td width="80" align="center"><input type="radio" onclick="Showfun()" name="credrad" id="r1" tabindex="10"/></td>
                      <td width="80" align="center"><input type="radio" onclick="Showfun1()" name="credrad" id="r2" TabIndex="11"/></td>
                      <td width="80" align="center"><input type="radio" onclick="Showfun()" name="credrad" id="r3" TabIndex="12"/></td>
                      <td width="80" align="center"><input type="radio" onclick="Showfun()" name="credrad" id="r4" TabIndex="14"/></td>
                      <td width="380" align="center">&nbsp;</td>
                      </tr>
                    </table>
                  
                  <div id="credit" runat="server" style="display:none">
                    <table width="100%">
                      <tr>
                        
                        <td colspan="2">
                          <table border="0" cellpadding="0" cellspacing="0" class="smallInfo">
                            <tr>
                              <td width="280" height="20" valign="bottom">Card Number 
                                with no spaces or dashes</td>
                              <td rowspan="3" valign="top"><table width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="80" height="20" valign="bottom">Exp Month</td>
                                  <td width="80" height="20" valign="bottom">Exp Year</td>
                                  <td height="20" valign="bottom">CVV Code <a href="javascript:void(0);" onmouseover="document.getElementById('cvvInfo').style.visibility='visible';" onmouseout="document.getElementById('cvvInfo').style.visibility='hidden'" style="border: 0;"><img src="images/question.gif" border="0"alt="This verification number is usually found on the back of your card, and is 3 or 4 digits." /></a>
                                    
                                    
                                    
                                    </td>
                                  </tr>
                                <tr>
                                  <td width="80" valign="top"><asp:DropDownList CssClass="dropDown1" ID="ddlXPMonth" runat="server" TabIndex="22">
                                    <asp:ListItem Text="Jan" Value="01"></asp:ListItem>
                                    <asp:ListItem Text="Feb" Value="02"></asp:ListItem>
                                    <asp:ListItem Text="Mar" Value="03"></asp:ListItem>
                                    <asp:ListItem Text="Apr" Value="04"></asp:ListItem>
                                    <asp:ListItem Text="May" Value="05"></asp:ListItem>
                                    <asp:ListItem Text="Jun" Value="06"></asp:ListItem>
                                    <asp:ListItem Text="Jul" Value="07"></asp:ListItem>
                                    <asp:ListItem Text="Aug" Value="08"></asp:ListItem>
                                    <asp:ListItem Text="Sep" Value="09"></asp:ListItem>
                                    <asp:ListItem Text="Oct" Value="10"></asp:ListItem>
                                    <asp:ListItem Text="Nov" Value="11"></asp:ListItem>
                                    <asp:ListItem Text="Dec" Value="12"></asp:ListItem>
                                    </asp:DropDownList></td>
                                  <td width="80" valign="top"><asp:DropDownList CssClass="dropDown1" ID="ddlXPYear" runat="server" TabIndex="23"> </asp:DropDownList></td>
                                  <td valign="top">
                                    <asp:TextBox Columns="4" CssClass="txtfield1" ID="txtCVV" Width="3em" runat="server" TabIndex="24"></asp:TextBox>
                                    
                                    <span class="smallInfo" style="width:140px;clear:left">
                                      <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                ErrorMessage="* CVV Code Required" ControlToValidate="txtCVV"></asp:RequiredFieldValidator>
                                      </span></td>
                                  </tr>
                                </table></td>
                              </tr>
                            
                            <tr>
                              <td align="left" valign="top" style="padding-right:15px;">
                                <span id="firrow" runat="server">
                                  <asp:TextBox  CssClass="txtfield1" ID="TB1" runat="server"  onkeypress="return isNumberKey(event)" Width="3em" onKeyup="next('TB1','4','TB2')" TabIndex="15"></asp:TextBox>
                                  <asp:TextBox  CssClass="txtfield1" ID="TB2" runat="server"  onkeypress="return isNumberKey(event)" Width="3em" onKeyup="next('TB2','4','TB3')" TabIndex="16"></asp:TextBox>
                                  <asp:TextBox  CssClass="txtfield1" ID="TB3" runat="server"  onkeypress="return isNumberKey(event)" Width="3em" onKeyup="next('TB3','4','TB4')" TabIndex="17"></asp:TextBox>
                                  <asp:TextBox  CssClass="txtfield1" ID="TB4" runat="server"  onkeypress="return isNumberKey(event)" MaxLength="4" Width="3em" onKeyup="next1('TB4','4','ddlXPMonth')" TabIndex="18"></asp:TextBox>
                                  <asp:Label ID="reqcard" runat="Server" ForeColor="red" />
                                  </span>
                                <span id="secrow" runat="server">
                                  <asp:TextBox  CssClass="txtfield1" ID="TB5" runat="server" MaxLength="4" Width="3em" onkeypress="return isNumberKey(event)" onKeyup="next('TB5','4','TB6')" TabIndex="19"></asp:TextBox>
                                  <asp:TextBox  CssClass="txtfield1" ID="TB6" runat="server" MaxLength="6" Width="4em" onkeypress="return isNumberKey(event)" onKeyup="next('TB6','6','TB7')" TabIndex="20"></asp:TextBox>
                                  <asp:TextBox  CssClass="txtfield1" ID="TB7" runat="server" MaxLength="5" onkeypress="return isNumberKey(event)"  Width="4em" onKeyup="next1('TB7','5','ddlXPMonth')" TabIndex="21"></asp:TextBox>
                                  <asp:Label ID="lblamex" runat="Server" ForeColor="red" />
                                  
                                  </span>
                                <asp:TextBox Columns="16" CssClass="txtfield1" ID="txtCCNum" runat="server" style="display:none"></asp:TextBox>
                                <asp:TextBox Columns="16" CssClass="txtfield1" ID="txtCvvType" Text="1" runat="server" style="display:none"></asp:TextBox>
                                </td>
                              </tr>
                            </table></td>
                        </tr>
                      </table>
                    <table border="0" cellpadding="0" cellspacing="0" class="smallInfo">
                      <tr>
                        <td height="10" colspan="4"></td>
                        </tr>
                      <tr>
                        <td width="250" style="padding-left:5px;">Billing Address</td>
                        <td width="120">City</td>
                        <td width="100">State</td>
                        <td>Zip</td>
                        </tr>
                      <tr>
                        <td style="padding-right:15px;padding-left:5px;"><asp:TextBox Columns="48" CssClass="txtfield1" ID="txtAddress1" runat="server" TabIndex="25" ></asp:TextBox>              
                          </td>
                        <td style="padding-right:15px;">
                          <asp:TextBox Columns="15" CssClass="txtfield1" ID="txtCity" runat="server" TabIndex="26"></asp:TextBox></td>
                        <td style="padding-right:15px;">
                          <asp:DropDownList ID="txtState" runat="server" CssClass="dropDown1" TabIndex="27">
                            <asp:ListItem>Texas</asp:ListItem>
                            <asp:ListItem Value="AL">Alabama</asp:ListItem>
                            <asp:ListItem Value="AK">Alaska</asp:ListItem>
                            <asp:ListItem Value="AZ">Arizona</asp:ListItem>
                            <asp:ListItem Value="AR">Arkansas</asp:ListItem>
                            <asp:ListItem Value="CA">California</asp:ListItem>
                            <asp:ListItem Value="CO">Colorado</asp:ListItem>
                            <asp:ListItem Value="CT">Connecticut</asp:ListItem>
                            <asp:ListItem Value="DC">District of Columbia</asp:ListItem>
                            <asp:ListItem Value="DE">Delaware</asp:ListItem>
                            <asp:ListItem Value="FL">Florida</asp:ListItem>
                            <asp:ListItem Value="GA">Georgia</asp:ListItem>
                            <asp:ListItem Value="HI">Hawaii</asp:ListItem>
                            <asp:ListItem Value="ID">Idaho</asp:ListItem>
                            <asp:ListItem Value="IL">Illinois</asp:ListItem>
                            <asp:ListItem Value="IN">Indiana</asp:ListItem>
                            <asp:ListItem Value="IA">Iowa</asp:ListItem>
                            <asp:ListItem Value="KS">Kansas</asp:ListItem>
                            <asp:ListItem Value="KY">Kentucky</asp:ListItem>
                            <asp:ListItem Value="LA">Louisiana</asp:ListItem>
                            <asp:ListItem Value="ME">Maine</asp:ListItem>
                            <asp:ListItem Value="MD">Maryland</asp:ListItem>
                            <asp:ListItem Value="MA">Massachusetts</asp:ListItem>
                            <asp:ListItem Value="MI">Michigan</asp:ListItem>
                            <asp:ListItem Value="MN">Minnesota</asp:ListItem>
                            <asp:ListItem Value="MS">Mississippi</asp:ListItem>
                            <asp:ListItem Value="MO">Missouri</asp:ListItem>
                            <asp:ListItem Value="MT">Montana</asp:ListItem>
                            <asp:ListItem Value="NE">Nebraska</asp:ListItem>
                            <asp:ListItem Value="NV">Nevada</asp:ListItem>
                            <asp:ListItem Value="NH">New Hampshire</asp:ListItem>
                            <asp:ListItem Value="NJ">New Jersey</asp:ListItem>
                            <asp:ListItem Value="NM">New Mexico</asp:ListItem>
                            <asp:ListItem Value="NY">New York</asp:ListItem>
                            <asp:ListItem Value="NC">North Carolina</asp:ListItem>
                            <asp:ListItem Value="ND">North Dakota</asp:ListItem>
                            <asp:ListItem Value="OH">Ohio</asp:ListItem>
                            <asp:ListItem Value="OK">Oklahoma</asp:ListItem>
                            <asp:ListItem Value="OR">Oregon</asp:ListItem>
                            <asp:ListItem Value="PA">Pennsylvania</asp:ListItem>
                            <asp:ListItem Value="RI">Rhode Island</asp:ListItem>
                            <asp:ListItem Value="SC">South Carolina</asp:ListItem>
                            <asp:ListItem Value="SD">South Dakota</asp:ListItem>
                            <asp:ListItem Value="TN">Tennessee</asp:ListItem>
                            <asp:ListItem Value="TX">Texas</asp:ListItem>
                            <asp:ListItem Value="UT">Utah</asp:ListItem>
                            <asp:ListItem Value="VT">Vermont</asp:ListItem>
                            <asp:ListItem Value="VA">Virginia</asp:ListItem>
                            <asp:ListItem Value="WA">Washington</asp:ListItem>
                            <asp:ListItem Value="WV">West Virginia</asp:ListItem>
                            <asp:ListItem Value="WI">Wisconsin</asp:ListItem>
                            <asp:ListItem Value="WY">Wyoming</asp:ListItem>
                            </asp:DropDownList>
                          </td>
                        <td style="padding-right:15px;">
                          <asp:TextBox Columns="10" CssClass="txtfield1" ID="txtZip" runat="server" TabIndex="28"></asp:TextBox>
                          </td>
                        </tr>
                      <tr>
                        <td><asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                            ControlToValidate="txtAddress1" ErrorMessage="* Address is Required"></asp:RequiredFieldValidator></td>
                        <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                    ErrorMessage="* City Required" ControlToValidate="txtCity"></asp:RequiredFieldValidator></td>
                        <td><asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                    ErrorMessage="* State Required" ControlToValidate="txtState"></asp:RequiredFieldValidator></td>
                        <td><asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                                    ErrorMessage="* Zip Required" ControlToValidate="txtZip"></asp:RequiredFieldValidator>
                          <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                    ControlToValidate="txtZip" ErrorMessage="* Invalid Zip Code" 
                                    ValidationExpression="\d{5}?"></asp:RegularExpressionValidator></td>
                        </tr>
                      </table>
                    
                    
                    </div>
                </td></tr>
              
                <tr>
                  
                  
                  <td colspan="2" align="right" valign="top" style="padding-top:10px;">               
                    <div style="padding-right:100px"><asp:Button CssClass="button" ID="btnSubmit" runat="server" 
                                Text="Submit Payment" OnClientClick="radValidt()" onclick="btnSubmit_Click" TabIndex="29"/></div>
                    <div style="padding-right:70px"><span class="mandatory">Please Press Just one time.</span></div></td>
                  
                  <td align="right" valign="top"><img src="../images/secure.gif" alt="secure" width="120" height="60" hspace="10" vspace="0" /></td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="3">
                    <!-- Error Messages here -->
                    <div runat="server" align="center" id="divErrorMessage" class="smallInfo" visible="false" style="font-family:Verdana, Geneva, sans-serif;font-size:12px;color:#F00;font-weight:bold;position:absolute; width:300px; height:100px; top:400px;left:40%;background:#e9f3fd; border:1px double #006; padding:10px; z-index:1000"><br /><asp:Literal runat="server" ID="errmsg" Text=""></asp:Literal></div>
                    
                    <div runat="server" id="divSuccessMessage" class="listInline" visible="false"></div>
                    <span runat="server" id="resultSpan"></span>
                    </td>
                </tr>
            </tfoot>
        </table>
</div>
    </form>
                <div id="cvvInfo" class="smallInfo" style="position:relative;margin:-200px 0px 0px 540px; visibility:hidden;width:220px;float:left;background-color:#CCC;border:1px solid #333;padding:10px;">This verification number is usually found on the back of your card, and is 3 or 4 digits.</div>    
                    
                  </td>
                </tr>
              </table></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td height="78" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="880" height="70" valign="middle" class="footer"><a href="../index.html">Home</a> | <a href="../disclaimer.html">Disclaimer</a> | <a href="../privacy.html">Privacy</a> | <a href="../sitemap-houston-mri.html">Sitemap</a> | <a href="../feedback.html">Feedback</a> | <a href="http://www.healthtoolsonline.com/TellAFriend1.asp" target="_blank">Tell a friend</a> | <a href="../contact-us-houston-mri.html">Contact Us</a>
              <h1 class="CopyrightText">&copy; Houston MRI Diagnostic Radiology Of Houston</h1></td>
            <td width="124" valign="top"><a href="http://www.yourpracticeonline.net/" target="_blank"><img src="../images/ypo-logo2.gif" alt="Your Practice Online" width="101" height="24" border="0" style="margin-top:20px;" /></a></td>
          </tr>
        </table></td>
    </tr>
  </table>
</div>
<!--Google Analytics -->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-25209145-5']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
function Showfun()
{
document.getElementById("txtCVV").value="";
 document.getElementById('<%=credit.ClientID%>').style.display="block";  
 document.getElementById('<%=secrow.ClientID%>').style.display="none"; 
 document.getElementById('<%=firrow.ClientID%>').style.display="block";  
 document.getElementById("txtCVV").maxLength=3;
var tc1 = document.getElementById('<%=TB1.ClientID%>').value;
var tc2 = document.getElementById('<%=TB2.ClientID%>').value;
var tc3 = document.getElementById('<%=TB3.ClientID%>').value;
var tc4 = document.getElementById('<%=TB4.ClientID%>').value;
tc5=tc1+tc2+tc3+tc4;
document.getElementById('txtCCNum').value=tc5;

document.getElementById('TB5').value="";
document.getElementById('TB6').value="";
document.getElementById('TB7').value="";
}
function Showfun1()
{
document.getElementById("txtCVV").value="";
document.getElementById('<%=credit.ClientID%>').style.display="block";
 document.getElementById('<%=secrow.ClientID%>').style.display="block"; 
 document.getElementById('<%=firrow.ClientID%>').style.display="none"; 
document.getElementById("txtCVV").maxLength=4;

var tc1 = document.getElementById('<%=TB5.ClientID%>').value;
var tc2 = document.getElementById('<%=TB6.ClientID%>').value;
var tc3 = document.getElementById('<%=TB7.ClientID%>').value;
camnt = tc1+tc2+tc3;
document.getElementById('txtCCNum').value = camnt;

document.getElementById('TB1').value="";
document.getElementById('TB2').value="";
document.getElementById('TB3').value="";
document.getElementById('TB4').value="";
}
   function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57)){
         alert('please check your Entry');return false;}
         else
            return true;
       }
function next1(currentControl, maxLength, nextControl)
   {
    if(document.getElementById(currentControl).value.length >= maxLength)
    document.getElementById('<%=ddlXPMonth.ClientID%>').focus();
    document.getElementById('<%=lblamex.ClientID%>').innerHTML="";
    document.getElementById('<%=reqcard.ClientID%>').innerHTML="";
    }   
	   
         
function next(currentControl, maxLength, nextControl)
   {
    if(document.getElementById(currentControl).value.length >= maxLength)
    document.getElementById(nextControl).focus();
    document.getElementById("TextBox1").maxLength=3;
    document.getElementById("TextBox2").maxLength=3;
    document.getElementById("TextBox3").maxLength=4;
    document.getElementById("Tbpay").maxLength=4;
    document.getElementById('TB1').maxLength=4;
   document.getElementById('TB2').maxLength=4;
   document.getElementById('TB3').maxLength=4;
   document.getElementById('TB4').maxLength=4;
   document.getElementById('TB5').maxLength=4;
   document.getElementById('TB6').maxLength=6;
     }

 function onClickSum() {
               var tp1=  document.getElementById('<%=TextBox1.ClientID%>').value;
               var tp2=  document.getElementById('<%=TextBox2.ClientID%>').value;
               var tp3=  document.getElementById('<%=TextBox3.ClientID%>').value;
               var pay1=  document.getElementById('<%=Tbpay.ClientID%>').value;
               var pay2=  document.getElementById('<%=Tbpam.ClientID%>').value;
               tp4=tp1+tp2+tp3;
               document.getElementById('txtPhone').value=tp4;
               pay3=pay1+'.'+pay2;
               document.getElementById('txtPayment').value=pay3; 
              }  
 function NumericTextBox(evt) {
               var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
			   
               if (charCode == 8 || //backspace
                    charCode == 46 || //delete
					charCode == 9 ||
                    charCode == 13)   //enter keY
               {
                   return true;
               }
			   else if(charCode == 190 || charCode == 110) //Check for dot(.)
			   {
			    document.getElementById("Tbpam").focus();
				return false;
			   }
               else if (charCode >= 37 && charCode <= 40) //arrow keys
               {
                   return true;
               }
               else if (charCode >= 48 && charCode <= 57) //0-9 on key pad
               {
                   return true;
               }
               else if (charCode >= 96 && charCode <= 105) //0-9 on num pad
               {
                   return true;
               }
               else
                   return false;
     
           } //end:NumericTextBox function	  
function radValidt( ) {

if((!document.frmMain.credrad[0].checked)&&(!document.frmMain.credrad[1].checked)&&(!document.frmMain.credrad[2].checked)&&(!document.frmMain.credrad[3].checked))
     {
    alert ('Select Your Credit Card');
     return false;
     }
          
else if(document.frmMain.credrad[1].checked)
{
if((document.getElementById('TB5').value == '')&&(document.getElementById('TB6').value == '')&&(document.getElementById('TB7').value == ''))
 document.getElementById('<%=lblamex.ClientID%>').innerHTML="*Required";
else{
 document.getElementById('<%=lblamex.ClientID%>').innerHTML="";
var tc1 = document.getElementById('<%=TB5.ClientID%>').value;
var tc2 = document.getElementById('<%=TB6.ClientID%>').value;
var tc3 = document.getElementById('<%=TB7.ClientID%>').value;
camnt = tc1+tc2+tc3;
document.getElementById('txtCCNum').value = camnt;
if((document.getElementById('txtCCNum').value.length)!=15)
alert('Invalid card Number');}
}
else{
if((document.getElementById('TB1').value == '')&&(document.getElementById('TB2').value == '')&&(document.getElementById('TB3').value == '')&&(document.getElementById('TB4').value == ''))
 document.getElementById('<%=reqcard.ClientID%>').innerHTML="*Required";
else{
document.getElementById('<%=reqcard.ClientID%>').innerHTML="";
var tc1 = document.getElementById('<%=TB1.ClientID%>').value;
var tc2 = document.getElementById('<%=TB2.ClientID%>').value;
var tc3 = document.getElementById('<%=TB3.ClientID%>').value;
var tc4 = document.getElementById('<%=TB4.ClientID%>').value;
tc5=tc1+tc2+tc3+tc4;
document.getElementById('txtCCNum').value=tc5;
if((document.getElementById('txtCCNum').value.length)!=16)
alert('Invalid card Number');}
}
}
              
</script>
<!--Google Analytics -->
</body>
</html>

Open in new window

Why does the <form> element have a runAt server attribute?

The error from "document.frmMain.credrad" saying that is not an object or null could be because frmMain is not being found.
Hi,

Are you talking about this -

<asp:Button CssClass="button" ID="btnSubmit" runat="server" 
                                Text="Submit Payment" OnClientClick="radValidt()" onclick="btnSubmit_Click" TabIndex="29"/>

Open in new window


If yes, then change it to -

<asp:Button CssClass="button" ID="btnSubmit" runat="server" 
                                Text="Submit Payment" OnClientClick="return radValidt();" onclick="btnSubmit_Click" TabIndex="29"/>

Open in new window


And inside the JavaScript function -  radValidt( ), return true on success, false on failure.

Hope it helps u...
Hello Sir,
But this form is working fine in my local system..In server its showing 'Unknown Runtime error'...please help to sort it out.......
I noticed that also onclick="btnSubmit_Click" should read onclick="btnSubmit_Click()"

>>please help to sort it out.......

If it works on one system but not on another then it must be that some default action is different, or that a newer version of the software enforces things differently.

Did you try any of the suggestions so far?
ASKER CERTIFIED SOLUTION
Avatar of Roopesh Reddy
Roopesh Reddy
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes its environment issue...In parallels plesk my server people changed the version of dot net to 4.0 but in my local i did it in 2.0..Now its working fine in server too.