Try to search your question here, if you can't find : Ask Any Question Now ?

Dynamically created Buttons are getting added after refresh

HomeCategory: stackoverflowDynamically created Buttons are getting added after refresh
Avatarrupesh asked 3 weeks ago

More buttons are dynamically created and added in div. My page has name and password field and submit button. Once I enter the value and click the submit button set of buttons will be created. When I do the refresh on the page I dont see any buttons in the page.But after refresh I enter the details and submit the form multiple buttons are created for example instead of 10 button 40 buttons are created.

if(($('#valuecheck').val())!="1")
                            {
                            for (i in so_values) {
                                var new_Button = $('<div class="col-md-2 top-space-20"><input type="button" class="btn" value="' + new_button[i]+'"></div>');
                                elements.push(new_Button);                                                                              
                            }

                            console.log("value check adding 1 wiht the value" + $('#valuecheck').val());
                            }

                            console.log("Elements length" + elements.length);                                
                        }
                    } 
                    if(($('#valuecheck').val())!="1")
                        {                                           
                    $("#resultDiv").html(msg);
                    if (elements!="" &&  elements.length > 0){

                        $("#resultDiv").append(elements);
                        $('#valuecheck').val("1");
1 Answers
Best Answer
AvatarMatthias answered 3 weeks ago
Your Answer

9 + 2 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com