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 6901665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:42:06+00:00 2026-05-27T07:42:06+00:00

I have this html form <form action=upload/ id=upload name=upload> // other form data </form>

  • 0

I have this html form

<form action="upload/" id="upload" name="upload">
// other form data
</form>

and this in html on page where i can switch form attributes

<a href="#" id="startDownload">Download</a>
<a href="#" id="startUpload">Upload</a>

and my javascript

$("#startUpload").click(function( {
    $("form").attr('action','upload/').attr('id','upload');
});

$("#startDownload").click(function( {
    $("form").attr('action','download/').attr('id','download');
});

$(function() {
    $('#upload').uploadThis({
        // other code here
    });
$(function() {
    $('#download').downloadThis({
        // other code here
    });

my problem is when i click on href #startUpload this is attached with $(‘#upload’).uploadThis({}) function and it works but when i click on #startDownload it is not attaching this $(‘#upload’).downloadThis({}) function and not getting called.

thanks for any help.

  • 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-27T07:42:06+00:00Added an answer on May 27, 2026 at 7:42 am

    I’m not sure exactly what is the wanted behavior but changing IDs of elements always brings the same sort of issues.

    You are doing this:

    $(function() {
        $('#upload').uploadThis({
            // other code here
        });
    });
    
    $(function() {
        $('#download').downloadThis({
            // other code here
        });
    });
    

    $(<Function>); is a shorthand for $(document).ready(<Function>);

    The thing is that when you’re document is ready, it will execute both your handlers above but at that time, only an element with ID #upload exists, $('#download') will actually be an empty selection.

    What you could do is call $('#upload').uploadThis() and $('#download').downloadThis() in your respective .click() handlers after changing the IDs.

    $("#startUpload").click(function( {
        $("form")
           .attr({ 'action': 'upload/', 'id': 'upload' })
           .uploadThis(...);
    });
    

    Note: if those are plugins you wrote yourself, be sure that they won’t initialize each time you call them.

    Hope I’m clear enough :o)

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

Sidebar

Related Questions

i have this html <ul> <li><form action=# name=formName></li> <li><input type=text name=someName /></li> <li><input type=text
I have this html code <form method=post id=upload_video enctype=multipart/form-data action=/Home/Save> <div id=form_box> <input type=text
I have a HTMl form <form action= method=post enctype=multipart/form-data> <p> Banner Ad Name :<br
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
I have a html form with the data by this post method 'form id='form1'
I have an html input field, such as <form method=post action=process.php enctype=multipart/form-data> <div> <h3>Files:</h3>
I have the following form: <html> <body> <form action=upload_file.php method=post enctype=multipart/form-data> <label for=file>Filename:</label> <input
I have this html form which has options: <tr> <td width=30 height=35><font size=3>*List:</td> <td
I have this form for inputting the birthday in html. But I only have
I have a form in a .html files where input/select box looks like this

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.