[jQuery] Re: [validate] -- newbie getting started
I know this is like the hello world of validate...can anyone see the issue? This is my first time using jquery and validate so my troubleshooting skills are not there yet. On Wed, Oct 22, 2008 at 10:11 AM, whitewaterbug [EMAIL PROTECTED]wrote: Thanks for the suggestions. I updated the form per suggestionsbut it still isn't doing the validation :( Here is the form now: -- html head script type=text/javascript src=jquery-1.2.6.min.js/script script type=text/javascript src=jquery.form.js/script script type=text/javascript src=jquery.validate.js/script script type=text/javascript src=jquery.metadata.js/script script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function //$('#myForm').ajaxForm(function() { //alert(Thank you for your comment!); $(#myForm).validate(); }); /script /head body FORM name=myForm2 id=myform ACTION= http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgihttp://www.cs.tut.fi/cgi-bin/run/%7Ejkorpela/echo.cgi METHOD=POST P Type something:BR TEXTAREA ROWS=5 COLS=72 NAME=Comments This is some text in several lines. /TEXTAREA p INPUT TYPE=checkbox NAME=box VALUE=yesCheck me! P email: INPUT Type=text name=myEmail class=required email INPUT TYPE=HIDDEN NAME=hiddenField VALUE=something INPUT name=mysubmit TYPE=SUBMIT VALUE=Send /FORM /body /html
[jQuery] [validate] -- newbie getting started
I am trying to get the validate plugin and the form plugin to work together. I would like to use in HTML markup to describe the validation, as it seems cleaner to read to me. So, I downloaded jquery, form, validate, and metadata...whipped up a quick form and tried it out. From firebug, I can see that all scripts are being downloaded successfully. But no validations are happening on th email text input. The tag I thought would turn the validation on is: INPUT Type=text class=required email Here is the actual form...what did I miss? thanks!! --- html head script type=text/javascript src=jquery-1.2.6.min.js/ script script type=text/javascript src=jquery.form.js/script script type=text/javascript src=jquery.validate.js/script script type=text/javascript src=jquery.metadata.js/script script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#myForm').ajaxForm(function() { alert(Thank you for your comment!); }); $(#myForm).validate(); }); /script /head body FORM id=myform ACTION=http://www.cs.tut.fi/cgi-bin/run/~jkorpela/ echo.cgi METHOD=POST P Type something:BR TEXTAREA ROWS=5 COLS=72 NAME=Comments This is some text in several lines. /TEXTAREA p INPUT TYPE=checkbox NAME=box VALUE=yesCheck me! P INPUT Type=text class=required email INPUT TYPE=HIDDEN NAME=hidden field VALUE=something INPUT TYPE=SUBMIT VALUE=Send /FORM /body /html
[jQuery] Re: [validate] -- newbie getting started
I just ran it again with a name entered for the email input and validate still didn't run. I then took the ajax forms script out to isolate to validate. It still didn't validate. I must be doing something simple wrong. Thanks. Here is my updated broken code/html: html head script type=text/javascript src=jquery-1.2.6.min.js/script script type=text/javascript src=jquery.form.js/script script type=text/javascript src=jquery.validate.js/script script type=text/javascript src=jquery.metadata.js/script script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function //$('#myForm').ajaxForm(function() { //alert(Thank you for your comment!); $(#myForm).validate(); }); /script /head body FORM id=myform ACTION= http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi; METHOD=POST P Type something:BR TEXTAREA ROWS=5 COLS=72 NAME=Comments This is some text in several lines. /TEXTAREA p INPUT TYPE=checkbox NAME=box VALUE=yesCheck me! P email: INPUT Type=text name=myEmail class=required email INPUT TYPE=HIDDEN NAME=hidden field VALUE=something INPUT name=mysubmit TYPE=SUBMIT VALUE=Send /FORM /body /html On Wed, Oct 22, 2008 at 9:11 AM, Jörn Zaefferer [EMAIL PROTECTED] wrote: Your input elements must have a name, otherwise the validation doesn't work. Jörn On Wed, Oct 22, 2008 at 2:49 PM, whitewaterbug [EMAIL PROTECTED] wrote: I am trying to get the validate plugin and the form plugin to work together. I would like to use in HTML markup to describe the validation, as it seems cleaner to read to me. So, I downloaded jquery, form, validate, and metadata...whipped up a quick form and tried it out. From firebug, I can see that all scripts are being downloaded successfully. But no validations are happening on th email text input. The tag I thought would turn the validation on is: INPUT Type=text class=required email Here is the actual form...what did I miss? thanks!! --- html head script type=text/javascript src=jquery-1.2.6.min.js/ script script type=text/javascript src=jquery.form.js/script script type=text/javascript src=jquery.validate.js/script script type=text/javascript src=jquery.metadata.js/script script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#myForm').ajaxForm(function() { alert(Thank you for your comment!); }); $(#myForm).validate(); }); /script /head body FORM id=myform ACTION=http://www.cs.tut.fi/cgi-bin/run/~jkorpela/http://www.cs.tut.fi/cgi-bin/run/%7Ejkorpela/ echo.cgi METHOD=POST P Type something:BR TEXTAREA ROWS=5 COLS=72 NAME=Comments This is some text in several lines. /TEXTAREA p INPUT TYPE=checkbox NAME=box VALUE=yesCheck me! P INPUT Type=text class=required email INPUT TYPE=HIDDEN NAME=hidden field VALUE=something INPUT TYPE=SUBMIT VALUE=Send /FORM /body /html
[jQuery] Re: [validate] -- newbie getting started
Thanks for the suggestions. I updated the form per suggestionsbut it still isn't doing the validation :( Here is the form now: -- html head script type=text/javascript src=jquery-1.2.6.min.js/script script type=text/javascript src=jquery.form.js/script script type=text/javascript src=jquery.validate.js/script script type=text/javascript src=jquery.metadata.js/script script type=text/javascript // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function //$('#myForm').ajaxForm(function() { //alert(Thank you for your comment!); $(#myForm).validate(); }); /script /head body FORM name=myForm2 id=myform ACTION= http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi; METHOD=POST P Type something:BR TEXTAREA ROWS=5 COLS=72 NAME=Comments This is some text in several lines. /TEXTAREA p INPUT TYPE=checkbox NAME=box VALUE=yesCheck me! P email: INPUT Type=text name=myEmail class=required email INPUT TYPE=HIDDEN NAME=hiddenField VALUE=something INPUT name=mysubmit TYPE=SUBMIT VALUE=Send /FORM /body /html
[jQuery] Re: using jquery to get at the img data???
Canvas sounds like it might do the trick. Is canvas supported on IE and firefox? I looked into dataurl and the other limitation is also the size of the image must be small, which doesn't work for my purposes either. On Mon, Oct 20, 2008 at 11:55 AM, Ca-Phun Ung [EMAIL PROTECTED] wrote: On Mon, Oct 20, 2008 at 6:19 AM, whitewaterbug [EMAIL PROTECTED]wrote: I believe this would require a 2nd download of the image so that it is within the applet. I am trying to get the actual image data into the applet through javascript to applet communication or having the applet access the DOM directly. I see, you might want to look into image data: URL. Basically you could use a backend script, such as PHP, to convert your image into base64 data and insert that directly into HTML. Another method would be to use canvas - insert the image into a canvas element, convert to base64 and extract as a string. Since the image data is downloaded as the HTML is being parsed by the browser...I am not sure if I can get at the image data. You will not have this problem if you use a data url because the image data is injected directly into HTML. A downer is I don't think IE6 and 7 support data URLs. -- Ca-Phun Ung + http://yelotofu.com + css, django, hongkong, html, javascript, php
[jQuery] using jquery to get at the img data???
I am trying to pull the image displayed in the DOM into an applet that will do some image processing (e.g. blur), show the updated image back in the DOM, and then print. Is there a way in jquery to do this? I found in JSobject, I can get attributes of the image, but I couldn't see how to actually get the image into the applet. On the return route, I couldn't figure out how to get the applet to update the DOM with the new image. Any ideas?
[jQuery] Re: using jquery to get at the img data???
I believe this would require a 2nd download of the image so that it is within the applet. I am trying to get the actual image data into the applet through javascript to applet communication or having the applet access the DOM directly. Since the image data is downloaded as the HTML is being parsed by the browser...I am not sure if I can get at the image data. I can push an image from applet to javascript and then into a hidden input field...but getting the image in the first place seems a bit challenging. On Oct 19, 9:48 am, Ca-Phun Ung [EMAIL PROTECTED] wrote: img id=myImage src=logo.gif / To get the image current image location: $('#myImage').attr('src'); To update DOM with new image use: $('#myImage').attr('src', [new image location]); On Sun, Oct 19, 2008 at 3:30 PM, whitewaterbug [EMAIL PROTECTED]wrote: I am trying to pull the image displayed in the DOM into an applet that will do some image processing (e.g. blur), show the updated image back in the DOM, and then print. Is there a way in jquery to do this? I found in JSobject, I can get attributes of the image, but I couldn't see how to actually get the image into the applet. On the return route, I couldn't figure out how to get the applet to update the DOM with the new image. Any ideas? -- Ca-Phun Ung +http://yelotofu.com + css, django, hongkong, html, javascript, php