Как поставить оповещение в форме - PullRequest
0 голосов
/ 20 января 2020

У меня есть таблица, и я добавляю новые строки путем клонирования существующей строки. Я хочу поместить оповещение по всей моей таблице, что, если какое-либо поле оставлено пустым, должно появиться всплывающее уведомление с указанием заполнить этот конкретный столбец. Я пытался сделать это, но мое оповещение применимо только к первой строке. Любая помощь будет признателен. Спасибо.

 $('#dataTable input:not([type=button]),#dataTable select').each(function () {
      var l_search = $( "#fldsearch" ).val();
    		if( l_search === 'S' ||  l_search === "" )
    		{ 
    		alert('Please select from the drop down');
    			return false;
    		}
    var l_desc = $( "#flddesc" ).val();
    		if(  l_desc === "" )
    		{ 
    		alert('Please fill the description');
    			return false;
    		}
    var l_img = $( "#fldimg" ).val();
    		if(  l_img === "")
    		{ 
    		alert('Please fill the image path');
    			return false;
    		}
    var l_url = $( "#fldurl" ).val();
    		if(  l_url === "" )
    		{ 
    		alert('Please fill the url');
    			return false;
    		}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table border="0" cellspacing="1" cellpadding="1" id="dataTable" name="dataTable" class="graphtable">
  <thead>
    <tr>
      <td class="headingalign" width="16%">Links</td>
      <td class="headingalign" width="32%">Desciption</td>
      <td class="headingalign" width="16%">Image</td>
      <td class="headingalign" width="16%">URL</td>
      <td class="headingalign" width="05%"></td>
    </tr>
  </thead>
  <tbody>
    <tr id="id0" class="vals" name="id0">
      <td>
        <div class="id_100">
          <select type="select-one" id='fldsearch' class="objselect" name="fldsearch" onChange="disableField(this)">
            <option value="S">Select</option>
            <xsl:for-each select="faml/response/qlwidgetresponsedto/searchby/datamapdto">
              <xsl:sort order="ascending" select="description" />
              <option value="#{description}">
                <xsl:value-of select="description" />
              </option>
            </xsl:for-each>
          </select>
        </div>
      </td>
      <td>
        <input id="flddesc" name="flddesc" maxlength="500" disabled="true" class="objinputtext1" size="85" value="{//RESPONSE}" />
      </td>
      <td>
        <input id="fldimg" name="fldimg" maxlength="50" disabled="true" class="objinputtext2" size="45" value="{//RESPONSE}" />
      </td>
      <td>
        <input id="fldurl" name="fldurl" maxlength="55" disabled="true" class="objinputtext3" size="40" value="{//RESPONSE}" />
      </td>
      <td>
        <input tabindex="6" value="Delete Row" disabled="true" class="DeleteButton" type="button" />
      </td>
    </tr>
  </tbody>
</table>

<div class="buttonarea">
  <ul>
    <li><input tabindex="6" id="Button3" value="Add New Row" class="Buttons" name="Button3" type="button" /></li>
    <li><input tabindex="6" id="Button5" value="Initiate" class="buttons" name="Button5" type="button" onclick="return fnOnSubmit();" /></li>
  </ul>
</div>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...