Note that there are some explanatory texts on larger screens.

plurals
  1. POCode is taking effect when it shouldn't be
    primarykey
    data
    text
    <p>I have a function where if the user clicks on a button, it will display a value in the textbox and it will perform a trigger to another function after a '#btn' button is clicked:</p> <pre><code>function addwindow(numberAnswer, gridValues, btn) { $('#mainNumberAnswerTxt').val(numberAnswer).data('data-ignore',true); $('#btn'+gridValues).trigger('click'); } </code></pre> <p>Now what I want to do is that:</p> <ol> <li><p>if the user clicked on the "Add" button, then display the number from the "Number of Answers" column into the textbox or in other words perform this from the <code>addwindow()</code> function:</p> <p><code>$('#mainNumberAnswerTxt').val(numberAnswer).data('data-ignore',true);</code></p></li> <li><p>If the user has clicked on a <code>#btn+gridValues</code> button, then display the number in the textbox of the number of buttons which are currently turned on or in other words perform this code:</p> <p><code>if ($('#mainNumberAnswerTxt').data('data-ignore') != true) { $('.answertxt', context).val(context.find('.answerBtnsOn').length &gt; 0 ? context.find('.answerBtnsOn').length : 0); }</code></p></li> </ol> <p>The problem is that step 1 works fine, it does display the number from the "Number of Answers" column in the textbox after the user has clicked on the "Add" button.</p> <p>The problem is step 2, it is not displaying the correct number on how many buttons are currently turned on after the user has clicked on the <code>#btn+gridValues</code> button.It just doesn't change the number in the textbox.</p> <p>Does anyone know why this is happening and how thi can be fixed?</p> <p>DEMO:</p> <p>Here is a <a href="http://helios.hud.ac.uk/u0867587/Mobile_app/Text14.php" rel="nofollow">demo</a> of the application. Please follow the steps below:</p> <p>Step 1: On left hand side you will see a green plus button, click on it and it opens up a modal window. Step 2: In modal window there is a search bar, type in "AAA" and submit search, you will see a bunch of rows appear. Step 3: In the last row, you see under "Number of Answer" colum that it contains the number 4, click on the "Add" button within this row, the modal window will close.</p> <p>You will see that the textbox displays the number 4 in the textbox which is fine as that was the number within the row under the "Number of Answers" column when you added the row.</p> <p>But below is the problem:</p> <p>Step 4: If you click on the "Open Grid" link and select button 3, you will see the letter buttons below change to A-C with only letter "B" turned on.</p> <p>In the textbox it should display number 1 as only 1 button is turned on, but it doesn't display this number and that is the problem I am having.</p> <p>How can this problem be fixed?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload