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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:08:09+00:00 2026-06-18T01:08:09+00:00

i wanna increment hidden field value append in jquery but its not incrementing just

  • 0

i wanna increment hidden field value append in jquery but its not incrementing just printing “2” when i print value beforing initializing it to hidden field my code is,

<script type="text/javascript">
    var k=0,j=0;
        $(document).ready(function () {
            $("#btnAdd").click(function () {
                var field = $("#field").val();
                 var DDL_fromProfession="<select name='ParametersFromProf' id='DDL_FromProYear'>";
                 for(var i=1950;i<2012;i++)
                 {
                 DDL_fromProfession +="<option text='"+i+"' value='"+i+"'>"+i+"</option>";
                 }
                 DDL_fromProfession +="</select>";
                var DDL_ToProfession="<select name='ParametersToProf'  id='DDL_ToProYear'>";
                for(var i=1950;i<2012;i++)
                 {
                 DDL_ToProfession +="<option text='"+i+"' value='"+i+"'>"+i+"</option>";
                 }
                 DDL_ToProfession +="</select>";
             k+=1;
                var newRow1="<tr><td align='center' style='font-size: large; color: #212121;' height='35px'>from"
                +DDL_fromProfession +" to "+DDL_ToProfession +"</td></tr>"
                +"<tr><td align='center' style='font-size:large;color:#212121;' height'35px'>"
                +"<input type='checkbox' name='chkbx_CurrPro"+k+"' value='Yes'>I currently work here</input>"
                +"<input type='hidden' id='hide' name='hidden' value='"+k+"'></input>";
               // alert(document.getElementByName("valPro").value);
                //alert($('input').attr('hidden'));
                //alert($('input#hide').val());

                var input = "<input name='parameters' id='field' type='text' />";
                var input1="<input name='parametersCompany' id='field' type='text'/>"
                var newRow = "<tr><td align='center' style='font-size: x-large; color: #212121;' height='35px'>" 
                + input + " at " +input1 +"</td></tr>";
                $('#controls').append(newRow);
                $('#controls').append(newRow1);
                var value = parseInt($(":hidden[name='hidden']").val()) + 1;
                alert(value);
            });
        });
    </script>

Hidden Field:

   +"<input type='hidden' id='hide' name='hidden' value='"+k+"'></input>";

Printing Value:

 var value = parseInt($(":hidden[name='hidden']").val()) + 1;
                alert(value);

Hopes for your suggestion

  • 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-18T01:08:11+00:00Added an answer on June 18, 2026 at 1:08 am

    I think you want the hidden value(:hidden[name='hidden']) = 2 (value writtent in alert)?

    Then you must write a line after var value = parseInt($(":hidden[name='hidden']").val()) + 1; => $(":hidden[name='hidden']").val(value);

    In this case your hidden value is 1 as you can test by alert(parseInt($(":hidden[name='hidden']").val()))

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

Sidebar

Related Questions

I wanna to detect an input tag that its name is: some[en] in jquery.
I wanna set a custom skin on my progressBar, but it's not working out
I want to Use Progressbar1.Increment but I wanna use Integer but the problem is
I wanna make a text editor but its different other text editors.It will get
$(document).ready(function(){ $(button).click(function(){ $(#inputtext).append(<input type='text' name='photo_1'/><br />); }) }) i wanna photo_1 to auto increment
I wanna create a infinite longlistselector, but my event ItemRealized does not fire. i
I wanna build a gallery, but the my problem is how to load the
I wanna read text between <p></p> tags which comes from database field. I think
I don't wanna use any other language. Just open the MongoDB's shell and create
i wanna print to a receipt printer. This would be plugged to a RS323

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.