Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3677640
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:14:46+00:00 2026-05-19T03:14:46+00:00

I have Form as <form name=selectdoctype method=post action= id=selectdoctype> <table style=border:none;> <tr><td colspan=2> (<span

  • 0

I have Form as

<form name="selectdoctype" method="post" action="" id="selectdoctype">
<table style="border:none;">
<tr><td colspan="2"> (<span class="asterisk" style="color:#FF0000;">*</span>) Mandatory</td></tr>
<tr>
    <td style="border-right:none">Document Name:</td>

    <td style="border-right:none">
        <input type="text" name="doc_name" value="" /><span class="asterisk" style="color:#FF0000;">*</span>
    </td>
</tr>
<tr>
    <td style="border-right:none">Document type:</td>
    <td style="border-right:none">
    <select name="doctype_id" onchange="doPaymentfor(this.value);"><option value="-1" >--Select Document Type--</option>
        <?php 
        foreach($arr_createdoc as $doctype){
        ?>
        <option value="<?php echo $doctype['doctype_id'];?>"><?php echo $doctype['doctype_name'];?></option>
        <?php }?>
    </select>
    </td>
</tr>

<tr>
    <td style="border-right:none" id="purchaselabel"></td>
    <td style="border-right:none">
    <select name="purchasedoc_id" id="purshasedocs" style="display:none;"><option value="-1" >--Select Document Type--</option>
        <?php 
        foreach($arr_purchasedoc as $docpurchase){
        ?>
        <option value="<?php echo $docpurchase['doc_id'];?>"><?php echo $docpurchase['doc_name'];?></option>
        <?php }?>
    </select>
    </td>
</tr>

<tr>
    <td style="border-right:none">Document Distribution:</td>

    <td style="border-right:none">
        <select name="distribution_id">
         <option value="-1">---Select Distriution---</option>
         <?php foreach($arr_distribution as $distribution){?>
         <option value="<?php echo $distribution['distribution_id'];?>"><?php echo $distribution['distribution_name'];?></option>
         <?php }?>
        </select>
    </td>
</tr>
<tr>
    <td colspan="2" align="center" style="border-right:none">
        <input type="button" name="submit" value="Proceed" class="submit" onclick="valdocAddEdit(this.form);"/>
    </td>
</tr>   
</table>
</form>

and javascript function as

function valdocAddEdit(frm) {
        if ((frm.doc_name.value == null) || (frm.doc_name.value == "")) {
            alert("Please enter Document Name!")
            frm.doc_name.focus()
            return false;
        }


        if(frm.doc_name.value.length > 50) {
            alert("Document Name can not be more than 20 characters!");
            frm.doc_name.focus();
            return false;
        } 



        if(frm.doctype_id.value == "-1") {
            alert("Please Select Document Type Name!");
            frm.doctype_id.focus();
            return false;
        } 

        if(frm.doctype_id.value == "1") {
            if(document.getElementById('purshasedocs').style.display == "block"){
                if(frm.purchasedoc_id.value == "-1"){
                    alert("Please Select Purchase Order Name!");
                    frm.purchasedoc_id.focus();
                    return false;
                }
            }
        } 

        if(frm.distribution_id.value == "-1") {
            alert("Please Select Distribution Name!");
            frm.distribution_id.focus();
            return false;
        } 
        frm.submit();

    }

But whenever all the javascript validation is verified the form doesnot get submitted as yields a javascript error as
” frm.submit is not a function” in firebug.

Could some one suggest me where the code is going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:14:46+00:00Added an answer on May 19, 2026 at 3:14 am

    You are not specifying form correctly.

    Quick Fix:

    Just below this line:

    function valdocAddEdit(frm) {
    

    Put:

    var frm = document.getElementById('selectdoctype');
    

    Meaning:

    function valdocAddEdit(frm) {
      var frm = document.getElementById('selectdoctype');
      .........
    }
    

    And now frm.submit(); shouldn’t complain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume I have a form class SampleClass(forms.Form): name = forms.CharField(max_length=30) age = forms.IntegerField() django_hacker
Say I have this simple form: class ContactForm(forms.Form): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True)
I have a form a user can enter their name, then it will add
I have a field in my form labeled Name that will contain both the
In Kohana/CodeIgniter, I can have a URL in this form: http://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ... And then
I have a website with a contact form. User submits name, email and message
I have a form generated dynamically with the method .append() of jQuery. I can
I have a form with Name : input and a submit. When pressed, it
I have a contact form on a website (a general form: name , email
I have URLs of the form http://domain/image/⟨uuid⟩/42x42/some_name.png . The Web server (nginx) is configured

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.