Set values in fields created dynamically











up vote
0
down vote

favorite












have a simple registration form which can replicate the same N times for N inscriver people at once.



I have to set the values ​​of the VALUE field depending on selected SELECT option Participant independently for each registration form dynamically created option.



I tried several things but I can not make the event ( on change) fired from a given SELECT change only the value of that piece of form created in javascript field.



I would like to create fields where SELECT fired an event that only alter its respective VALUE field according to the selected users in the SELECT option and that the trigger its SELECT, the VALUE field of the registration form to receive the value of the select value changed. I want this to happen independently created for all sections on the form .



I'm having the following problem, it seems that other SELECTS created dynamically follow the original select . Are not independent.



How can I fix this? The link below is the source code and the same



link: http://jsbin.com/lupeweha/5










share|improve this question




















  • 2




    You have not pasted link. Moreover add your code here at StackOverflow.
    – Satpal
    May 17 '14 at 20:58












  • Sorry, the code is huge, I'll put.
    – Elton da Costa
    May 17 '14 at 21:11






  • 2




    Add only relevant code
    – Satpal
    May 17 '14 at 21:15















up vote
0
down vote

favorite












have a simple registration form which can replicate the same N times for N inscriver people at once.



I have to set the values ​​of the VALUE field depending on selected SELECT option Participant independently for each registration form dynamically created option.



I tried several things but I can not make the event ( on change) fired from a given SELECT change only the value of that piece of form created in javascript field.



I would like to create fields where SELECT fired an event that only alter its respective VALUE field according to the selected users in the SELECT option and that the trigger its SELECT, the VALUE field of the registration form to receive the value of the select value changed. I want this to happen independently created for all sections on the form .



I'm having the following problem, it seems that other SELECTS created dynamically follow the original select . Are not independent.



How can I fix this? The link below is the source code and the same



link: http://jsbin.com/lupeweha/5










share|improve this question




















  • 2




    You have not pasted link. Moreover add your code here at StackOverflow.
    – Satpal
    May 17 '14 at 20:58












  • Sorry, the code is huge, I'll put.
    – Elton da Costa
    May 17 '14 at 21:11






  • 2




    Add only relevant code
    – Satpal
    May 17 '14 at 21:15













up vote
0
down vote

favorite









up vote
0
down vote

favorite











have a simple registration form which can replicate the same N times for N inscriver people at once.



I have to set the values ​​of the VALUE field depending on selected SELECT option Participant independently for each registration form dynamically created option.



I tried several things but I can not make the event ( on change) fired from a given SELECT change only the value of that piece of form created in javascript field.



I would like to create fields where SELECT fired an event that only alter its respective VALUE field according to the selected users in the SELECT option and that the trigger its SELECT, the VALUE field of the registration form to receive the value of the select value changed. I want this to happen independently created for all sections on the form .



I'm having the following problem, it seems that other SELECTS created dynamically follow the original select . Are not independent.



How can I fix this? The link below is the source code and the same



link: http://jsbin.com/lupeweha/5










share|improve this question















have a simple registration form which can replicate the same N times for N inscriver people at once.



I have to set the values ​​of the VALUE field depending on selected SELECT option Participant independently for each registration form dynamically created option.



I tried several things but I can not make the event ( on change) fired from a given SELECT change only the value of that piece of form created in javascript field.



I would like to create fields where SELECT fired an event that only alter its respective VALUE field according to the selected users in the SELECT option and that the trigger its SELECT, the VALUE field of the registration form to receive the value of the select value changed. I want this to happen independently created for all sections on the form .



I'm having the following problem, it seems that other SELECTS created dynamically follow the original select . Are not independent.



How can I fix this? The link below is the source code and the same



link: http://jsbin.com/lupeweha/5







javascript jquery html5 javascript-events






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 6:54









Cœur

17.1k9102140




17.1k9102140










asked May 17 '14 at 20:51









Elton da Costa

8401022




8401022








  • 2




    You have not pasted link. Moreover add your code here at StackOverflow.
    – Satpal
    May 17 '14 at 20:58












  • Sorry, the code is huge, I'll put.
    – Elton da Costa
    May 17 '14 at 21:11






  • 2




    Add only relevant code
    – Satpal
    May 17 '14 at 21:15














  • 2




    You have not pasted link. Moreover add your code here at StackOverflow.
    – Satpal
    May 17 '14 at 20:58












  • Sorry, the code is huge, I'll put.
    – Elton da Costa
    May 17 '14 at 21:11






  • 2




    Add only relevant code
    – Satpal
    May 17 '14 at 21:15








2




2




You have not pasted link. Moreover add your code here at StackOverflow.
– Satpal
May 17 '14 at 20:58






You have not pasted link. Moreover add your code here at StackOverflow.
– Satpal
May 17 '14 at 20:58














Sorry, the code is huge, I'll put.
– Elton da Costa
May 17 '14 at 21:11




Sorry, the code is huge, I'll put.
– Elton da Costa
May 17 '14 at 21:11




2




2




Add only relevant code
– Satpal
May 17 '14 at 21:15




Add only relevant code
– Satpal
May 17 '14 at 21:15












1 Answer
1






active

oldest

votes

















up vote
0
down vote













I see you actually fire the event on the select by calling the "select" element, which then fires the same event on ALL the selects! Create ids, and then call your functions independently.



function bindSelect(){
$('select').on('change', function() {
....

// hey, here all the selects get this function, on change.

$('#main-select').on('change', function() {
...

$('#other-select1').on('change', function() {
...

$('#other-select2').on('change', function() {


Hope it helps.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f23715965%2fset-values-in-fields-created-dynamically%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I see you actually fire the event on the select by calling the "select" element, which then fires the same event on ALL the selects! Create ids, and then call your functions independently.



    function bindSelect(){
    $('select').on('change', function() {
    ....

    // hey, here all the selects get this function, on change.

    $('#main-select').on('change', function() {
    ...

    $('#other-select1').on('change', function() {
    ...

    $('#other-select2').on('change', function() {


    Hope it helps.






    share|improve this answer

























      up vote
      0
      down vote













      I see you actually fire the event on the select by calling the "select" element, which then fires the same event on ALL the selects! Create ids, and then call your functions independently.



      function bindSelect(){
      $('select').on('change', function() {
      ....

      // hey, here all the selects get this function, on change.

      $('#main-select').on('change', function() {
      ...

      $('#other-select1').on('change', function() {
      ...

      $('#other-select2').on('change', function() {


      Hope it helps.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I see you actually fire the event on the select by calling the "select" element, which then fires the same event on ALL the selects! Create ids, and then call your functions independently.



        function bindSelect(){
        $('select').on('change', function() {
        ....

        // hey, here all the selects get this function, on change.

        $('#main-select').on('change', function() {
        ...

        $('#other-select1').on('change', function() {
        ...

        $('#other-select2').on('change', function() {


        Hope it helps.






        share|improve this answer












        I see you actually fire the event on the select by calling the "select" element, which then fires the same event on ALL the selects! Create ids, and then call your functions independently.



        function bindSelect(){
        $('select').on('change', function() {
        ....

        // hey, here all the selects get this function, on change.

        $('#main-select').on('change', function() {
        ...

        $('#other-select1').on('change', function() {
        ...

        $('#other-select2').on('change', function() {


        Hope it helps.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 18 '14 at 0:15









        Giancarlo PSK

        1867




        1867






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f23715965%2fset-values-in-fields-created-dynamically%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Error while running script in elastic search , gateway timeout

            Adding quotations to stringified JSON object values