I would like to use JQueryValidation (https://jqueryvalidation.org/) in my application, but I am not sure now to do a few things. - how do i go about including the source? I will probably just use a CDN link. How to i insert that into the head? - how do i got about inserting the directive? The html will look something like:
I also need to insert a javascript snippet: $("#commentForm").validate(); How do insert that? Thanks! ---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Sergio,
Try with this: html textInput id: 'cname'; name: 'name'; attributeAt: 'required' put: true; callback: [:v | ... ]. html script: (html jQuery id: 'commentForm') validate. Regards, Esteban A. Maringolo El mar., 5 feb. 2019 a las 16:44, sergio ruiz (<[hidden email]>) escribió: > > I would like to use JQueryValidation (https://jqueryvalidation.org/) in my application, but I am not sure now to do a few things. > > - how do i go about including the source? I will probably just use a CDN link. How to i insert that into the head? > - how do i got about inserting the directive? > > The html will look something like: > > <input id="cname" name="name" minlength="2" type="text" required> > > > How do I insert that “required” directive? > > I also need to insert a javascript snippet: > > $("#commentForm").validate(); > > How do insert that? > > Thanks! > > > ---- > peace, > sergio > photographer, journalist, visionary > > Public Key: http://bit.ly/29z9fG0 > #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV > http://www.codeandmusic.com > http://www.twitter.com/sergio_101 > http://www.facebook.com/sergio101 > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Awesome! trying now.. how do include the the CDN in the header? Thanks! On February 5, 2019 at 2:48:33 PM, Esteban Maringolo ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
I got it.. added this to my updateRoot method: anHtmlRoot script url: On February 5, 2019 at 2:56:10 PM, sergio ruiz ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
okay, on this, smalltalk doesn’t know what validate is.. this validate method is coming from an external javascript library.. so smalltalk wouldn’t know about it.. ---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Oh, sorry I assumed validate was already defined, you can then do:
html script: ((html jQuery id: 'commentForm') call: 'validate'). Or implement validate in JQueryInstance as follows: JQueryInstance>>#validate ^self call: 'validate' If you plan to use validate extensively I recommend you do the latter. Regards, Esteban A. Maringolo El mar., 5 feb. 2019 a las 17:44, sergio ruiz (<[hidden email]>) escribió: > > > html script: (html jQuery id: 'commentForm') validate. > > > okay, on this, smalltalk doesn’t know what validate is.. > > this validate method is coming from an external javascript library.. so smalltalk wouldn’t know about it.. > > > ---- > peace, > sergio > photographer, journalist, visionary > > Public Key: http://bit.ly/29z9fG0 > #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV > http://www.codeandmusic.com > http://www.twitter.com/sergio_101 > http://www.facebook.com/sergio101 > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Perfect! i ended up cheating and doing: html script: '$("#dataForm").validate();$("#enterZipCOde").rules( "add", {minlength: 5, digits: true});’ but i’ll clean that up.. Thanks! On February 5, 2019 at 3:58:56 PM, Esteban Maringolo ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Just a minor fix.
If you're going to inline JS code directly the proper way to do it is by using a JSStream. So: html script: (JSStream on: '$("#dataForm").validate();$("#enterZipCOde").rules( "add", {minlength: 5, digits: true});’) Regards, Esteban A. Maringolo El mar., 5 feb. 2019 a las 18:34, sergio ruiz (<[hidden email]>) escribió: > > Perfect! i ended up cheating and doing: > > html > script: > '$("#dataForm").validate();$("#enterZipCOde").rules( "add", {minlength: 5, digits: true});’ > > but i’ll clean that up.. > > Thanks! > > On February 5, 2019 at 3:58:56 PM, Esteban Maringolo ([hidden email]) wrote: > > Oh, sorry I assumed validate was already defined, you can then do: > > html script: ((html jQuery id: 'commentForm') call: 'validate'). > > Or implement validate in JQueryInstance as follows: > > JQueryInstance>>#validate > ^self call: 'validate' > > If you plan to use validate extensively I recommend you do the latter. > > Regards, > > > Esteban A. Maringolo > > > > El mar., 5 feb. 2019 a las 17:44, sergio ruiz (<[hidden email]>) escribió: > > > > > > html script: (html jQuery id: 'commentForm') validate. > > > > > > okay, on this, smalltalk doesn’t know what validate is.. > > > > this validate method is coming from an external javascript library.. so smalltalk wouldn’t know about it.. > > > > > > ---- > > peace, > > sergio > > photographer, journalist, visionary > > > > Public Key: http://bit.ly/29z9fG0 > > #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV > > http://www.codeandmusic.com > > http://www.twitter.com/sergio_101 > > http://www.facebook.com/sergio101 > > _______________________________________________ > > seaside mailing list > > [hidden email] > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > ---- > peace, > sergio > photographer, journalist, visionary > > Public Key: http://bit.ly/29z9fG0 > #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV > http://www.codeandmusic.com > http://www.twitter.com/sergio_101 > http://www.facebook.com/sergio101 > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Perfect! thanks! On February 5, 2019 at 4:43:45 PM, Esteban Maringolo ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |