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

  • SEARCH
  • Home
  • 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 9054577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:43:26+00:00 2026-06-16T13:43:26+00:00

Below is the function where it handles a normal submit button: <script type=text/javascript> $(function()

  • 0

Below is the function where it handles a normal submit button:

<script type="text/javascript">                 
   $(function() {
      myClickHandler=function(e){
        if (!validation())
            return false;    
        if (!confirm("Are you sure you want to Proceed?" + "\n" ))
            return false;    
        return true;
    };  
    $('#QandA').submit(myClickHandler);
});

</script>

Below I am showing how the imageuploadform, audiouploadform and video uploadform is appended into a table which is in the #QandA form:

jquery:

function insertQuestion(form) { 
    var $image = $("<td class='image'></td>"); 
    var $fileImage = $("<form action='imageupload.php' method='post' 
                    enctype='multipart/form-data' target='upload_target_image'
                    onsubmit='return imageClickHandler(this);' 
                    class='imageuploadform' >" +
                    "Image File: <input name='fileImage' type='file' 
                    class='fileImage' /></label><br/><br/><label class='imagelbl'>" +
                    "<input type='submit' name='submitImageBtn' 
                    class='sbtnimage' value='Upload' /></label></form>");
    $image.append($fileImage);
    $tr.append($image);  

        var $video = $("<td class='video'></td>"); 
var $fileVideo = $("<form action='videoupload.php' method='post' 
                enctype='multipart/form-data' target='upload_target_video'
                onsubmit='return videoClickHandler(this);' 
                class='videouploadform' >" +
                "Video File: <input name='fileVideo' type='file' 
                class='fileVideo' /></label><br/><br/><label class='videolbl'>" +
                "<input type='submit' name='submitVideoBtn' 
                class='sbtnvideo' value='Upload' /></label></form>");
$video.append($fileVideo);
$tr.append($video);  


        var $audio = $("<td class='audio'></td>"); 
var $fileAudio = $("<form action='audioupload.php' method='post' 
                enctype='multipart/form-data' target='upload_target_audio'
                onsubmit='return audioClickHandler(this);' 
                class='audiouploadform' >" +
                "Audio File: <input name='fileAudio' type='file' 
                class='fileAudio' /></label><br/><br/><label class='audiolbl'>" +
                "<input type='submit' name='submitAudioBtn' 
                class='sbtnaudio' value='Upload' /></label></form>");
$audio.append($fileAudio);
$tr.append($audio);  

}

HTML (#QandA form):

   <form id="QandA" action="<?php echo htmlentities($action); ?>" method="post">

//image, video and audio upload form is appended into table below:

<table id="qandatbl" align="center" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
    <th class="image">Image</th>
    <th class="video">Video</th>
    <th class="audio">Audio</th>
</tr>
</thead>
</table>
<div id="qandatbl_onthefly_container">
<table id="qandatbl_onthefly" align="center" cellpadding="0" cellspacing="0" border="0">
<tbody>
</tbody>
</table>

    <p><input id="submitBtn" name="submitDetails" type="submit" value="Submit Details" /></p>

    </form>

Now what is happening is that the image, video and audio upload submit buttons are triggering the myClickHandler() function which it shouldn’t,only the #submitBtn should trigger this function. How can I stop the image, audio and video upload buttons from triggering the myClickHandler() function.

UPDATE:

<script type="text/javascript">                 
   $(function() {

    $('#submitBtn').click(myClickHandler(e)) 
});

      function myClickHandler(e){
        if (!validation())
            return false;    
        if (!confirm("Are you sure you want to Proceed?" + "\n" ))
            return false;    
        return true;
    }; 

</script>
  • 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-06-16T13:43:27+00:00Added an answer on June 16, 2026 at 1:43 pm

    The issue is that you have the myClickHandler() attached to all submit buttons which includes the video, audio, and image submit buttons.

    Attach it to only the #submitBtn

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

Sidebar

Related Questions

I am using the below function of javascript to enable and disable the radio
Some question on java basics, the below function returns an object of Node type
I have two button as shown below: 1st Button: <asp:Button ID=btn1 runat=server Text=First Button
Is there a php function to handle the encodings below? .replaceAll(\u00c3\u0080, &Agrave;) .replaceAll(\u00c3\u0081, &Aacute;)
When I use jQuery event listener to handle message event, like below: $(window).on('message', function(e)
When I put the below function into leon repl , I get java.lang.IllegalArgumentException: Wrong
Anyone experienced exception using below function? tdse.GetObject(tmpFolderWebDavURL, EnumOpenMode.OpenModeView, null, XMLReadFilter.XMLReadAll) as Folder; Seems if
I would like the below function to be more flexible and accept multiple callbacks
let say i have function like below function doSomethingNow(){ callSomethingInFutureNotExistNow(); } at the moment
AIM: I would like to set the below function to call every 5 seconds.

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.