- Screen name: ddelella
ddelella's Profile
5 Posts
3 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 22-Apr-2020 01:09 PM
- Forum: Using jQuery Plugins
I have a simple test form with three fields. Two required, one not required, and one minimum length. I am using jquery validation unobtrusive with Bootstrap 4. The first field validates fine but the last field in the form is not validated at all and I am able to reach the submit handler with an invalid form. Please help.- 07-Mar-2016 06:26 PM
- Forum: Using jQuery Plugins
When declaring a validation form using the jQuery Validation plug-in I can override the showErrors handler to customize the output of the message. If I wanted to create several methods for handling and let the designers choose which method they want by just giving the global function name, is that possible?For example:STANDARD
$("#MyForm").validate({
rules: {...
},
showErrors: function (errorMap, errorList) {
... code here ...
}
});LOOKING TO DO$("#MyForm").validate({
rules: {...
},
showErrors: handlingFunctionName
});- 01-Mar-2015 04:39 PM
- Forum: Using jQuery
I have a table that loads just fine. Each row has an ID matching the database. The last row in the table is there to insert a new row. When the user clicks the Add button the data is added to the database and the row is displayed in the table. Each row in the table contains a button for deleting that row. Here is the button markup:
- <button class="btn btn-default delete-increment" aria-label="Delete" data-id="1">
- <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
- <span class="sr-only">Delete</span>
- </button>
There is a jQuery function which detects a click of this button by the class name delete-increment. It then deletes the item from the database and the table. The delete buttons work fine when the table is initially populated. However, when a new row is added and you click the delete button for that row it does not trigger the function. I did confirm that after adding a new row all the other delete buttons still work. The issue appear to be with just new rows added after the page load.
- $('[class~=delete-increment').click(function () {
- ...
- });
Here is the code used to insert the new row:
- $('#my-table tr:last').prev().after('<tr id="LayoutContent_increment-' + data.d + '"><td>$' + Start + '</td><td>$' + End + '</td><td>$' + Increment + '</td><td class="action" style="text-align: center"><button class="btn btn-default delete-increment" aria-label="Delete" data-id="' + data.d + '"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span><span class="sr-only">Delete</span></button></td></tr>');
Anyone know why only the new rows added do not trigger the click function?
With the following code I need to locate all elements with a cell_name that starts with the word Driver. Once I identify these rows I need to select the data_table element within the same row and change the css class. Any help with a fast and efficient query.
- <table>
<tbody>
<tr class="row_folder">
<td class="matrix_cell">
<div>
<div class="cell_name">Driver #1</div>
</div>
</td>
<td class="matrix_line">
<div>
<table class="data_table folder">
...
</table>
</div>
</td>
</tr>
...
</tbody>
</table>
- When attaching the uncompressed jquery-2.1.1.js file to the YUI Compressor .NET MSBuild task produces the following errors in the output window:Exception was thrown at line 2, column 10423 in http://localhost:52769/Scripts/myscripts.min.js0x800a139e - JavaScript runtime error: SyntaxErrorException was thrown at line 2, column 10648 in http://localhost:52769/Scripts/myscripts.min.js0x800a139e - JavaScript runtime error: SyntaxErrorHere is the Layout.master page inclusion:<ajax:ToolkitScriptManager ID="AjaxScriptManager" runat="server" AsyncPostBackTimeout ="360000"><Scripts><asp:ScriptReference Path="~/Scripts/myscripts.min.js" /></Scripts></ajax:ToolkitScriptManager>Here is the build file:<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003"><UsingTask TaskName="JavaScriptCompressorTask" AssemblyFile="..\packages\YUICompressor.NET.MSBuild.2.4.0.0\lib\NET20\Yahoo.Yui.Compressor.Build.MsBuild.dll" /><Target Name="Clean"><Exec Command="del /F /Q Scripts\*.min.js" /></Target><Target Name="Minify" AfterTargets="Clean"><ItemGroup><JavaScript Include="Scripts\jquery-2.1.1.js" /></ItemGroup><JavaScriptCompressorTask SourceFiles="@(JavaScript)" DeleteSourceFiles="false" ObfuscateJavaScript="False" OutputFile="Scripts\myscripts.min.js" /></Target></Project>
- «Prev
- Next »
- <table>
Moderate user : ddelella
© 2013 jQuery Foundation
Sponsored by and others.

