[jQuery] Re: Problem with jquery.validate.js
Thanks again Jorn, you've been a big help... If anyone can help me, I'd appreciate it, I just need to ask two more questions. My test page is here: http://paulcollinslondon.com/contactTest.php I'd just like to know: - How can I actually remove HTML and replace it with the JQuery code, instead of just adding the new code after it? - How can I submit the form using JQuery after I remove the submit button and replace it with a HREF? Any help/links would be greatly appreciated. Cheers Paul On 27/03/2008, Jörn Zaefferer [EMAIL PROTECTED] wrote: Paul Collins schrieb: Thanks for your help Jörn, that's solved that part of my equation. I'm stuck again! I would like to find out how to get the value of an id that ends in _replace So for instance, I have the following line that looks for a input tag with the type of submit, that has an id ending with _replace. (It can have anything before that). So, for EG: input type=submit id=sendButton_replace value=Send/ I then want to get the entire content of the id and store it into a variable. I would also like to get the text in the Value and store it as another variable. I currently have: $(document).ready(function(){ $(:submit[id$='_replace']); var replaceID = $(:submit[id$='_replace']).val; alert (replaceID); return false; }); How about... $(:submit[id$='_replace']).attr(id) Jörn
[jQuery] Re: Problem with jquery.validate.js
Hi all, I've managed to replace the submit button with the following code: a class=replace sendButton_replace id=sendButton_replace href=em/emSend/a All I would like to know now is, how can I create the link for a HREF to submit the form? The catch is, I would like it to work with the ajax validator plugin. Any help is greatly appreciated. Cheers paul On 28/03/2008, Paul Collins [EMAIL PROTECTED] wrote: Thanks again Jorn, you've been a big help... If anyone can help me, I'd appreciate it, I just need to ask two more questions. My test page is here: http://paulcollinslondon.com/contactTest.php I'd just like to know: - How can I actually remove HTML and replace it with the JQuery code, instead of just adding the new code after it? - How can I submit the form using JQuery after I remove the submit button and replace it with a HREF? Any help/links would be greatly appreciated. Cheers Paul On 27/03/2008, Jörn Zaefferer [EMAIL PROTECTED] wrote: Paul Collins schrieb: Thanks for your help Jörn, that's solved that part of my equation. I'm stuck again! I would like to find out how to get the value of an id that ends in _replace So for instance, I have the following line that looks for a input tag with the type of submit, that has an id ending with _replace. (It can have anything before that). So, for EG: input type=submit id=sendButton_replace value=Send/ I then want to get the entire content of the id and store it into a variable. I would also like to get the text in the Value and store it as another variable. I currently have: $(document).ready(function(){ $(:submit[id$='_replace']); var replaceID = $(:submit[id$='_replace']).val; alert (replaceID); return false; }); How about... $(:submit[id$='_replace']).attr(id) Jörn
[jQuery] Re: Problem with jquery.validate.js
Hi all, Sorry to keep pestering, maybe I can make my request simpler so someone can help. I am using the Validator plugin, I would like to replace the submit button with an image using JQuery. The only problem is when I want to submit the form using a HREF, I need to somehow submit to the validator plugin. Here is my code currently: href=javascript:$(this).validate(); This doesn't seem to work correctly, here is my full block of code in case you would like to check. I would greatly appreciate any help or links. $(document).ready(function(){ $(:submit[id$='_replace']).each(function() { var submitID = $(this).attr(id); var submitValue = $(this).attr(value); $(this).replaceWith( [ 'a class=replace ' , submitID , ' id=' , submitID , ' href=javascript:$(this).validate();em/em' , submitValue , '/a' ].join('') ); }); return false; }); Cheers On 28/03/2008, Paul Collins [EMAIL PROTECTED] wrote: Hi all, I've managed to replace the submit button with the following code: a class=replace sendButton_replace id=sendButton_replace href=em/emSend/a All I would like to know now is, how can I create the link for a HREF to submit the form? The catch is, I would like it to work with the ajax validator plugin. Any help is greatly appreciated. Cheers paul On 28/03/2008, Paul Collins [EMAIL PROTECTED] wrote: Thanks again Jorn, you've been a big help... If anyone can help me, I'd appreciate it, I just need to ask two more questions. My test page is here: http://paulcollinslondon.com/contactTest.php I'd just like to know: - How can I actually remove HTML and replace it with the JQuery code, instead of just adding the new code after it? - How can I submit the form using JQuery after I remove the submit button and replace it with a HREF? Any help/links would be greatly appreciated. Cheers Paul On 27/03/2008, Jörn Zaefferer [EMAIL PROTECTED] wrote: Paul Collins schrieb: Thanks for your help Jörn, that's solved that part of my equation. I'm stuck again! I would like to find out how to get the value of an id that ends in _replace So for instance, I have the following line that looks for a input tag with the type of submit, that has an id ending with _replace. (It can have anything before that). So, for EG: input type=submit id=sendButton_replace value=Send/ I then want to get the entire content of the id and store it into a variable. I would also like to get the text in the Value and store it as another variable. I currently have: $(document).ready(function(){ $(:submit[id$='_replace']); var replaceID = $(:submit[id$='_replace']).val; alert (replaceID); return false; }); How about... $(:submit[id$='_replace']).attr(id) Jörn
[jQuery] Re: Problem with jquery.validate.js
Thanks for your help Jörn, that's solved that part of my equation. I'm stuck again! I would like to find out how to get the value of an id that ends in _replace So for instance, I have the following line that looks for a input tag with the type of submit, that has an id ending with _replace. (It can have anything before that). So, for EG: input type=submit id=sendButton_replace value=Send/ I then want to get the entire content of the id and store it into a variable. I would also like to get the text in the Value and store it as another variable. I currently have: $(document).ready(function(){ $(:submit[id$='_replace']); var replaceID = $(:submit[id$='_replace']).val; alert (replaceID); return false; }); On 26/03/2008, Jörn Zaefferer [EMAIL PROTECTED] wrote: Paul Collins schrieb: Hi all, As a follow up to this, I've decided to try and rewrite the image replace script with JQuery, so I can re-use it. The one thing I can't seem to find any info on at the moment is doing a search for only part of an ID. So in this instance, I would like to search for all submit input tags in a form that have an ID ending in _replace. So the ID might be called submit_replace. I would only like to search for the _replace part of any ID in the form. So far I have: $('form').find('#_replace').addClass(_replace); Take a look at: http://docs.jquery.com/Selectors http://docs.jquery.com/Selectors/attributeEndsWith#attributevalue Jörn
[jQuery] Re: Problem with jquery.validate.js
Paul Collins schrieb: Thanks for your help Jörn, that's solved that part of my equation. I'm stuck again! I would like to find out how to get the value of an id that ends in _replace So for instance, I have the following line that looks for a input tag with the type of submit, that has an id ending with _replace. (It can have anything before that). So, for EG: input type=submit id=sendButton_replace value=Send/ I then want to get the entire content of the id and store it into a variable. I would also like to get the text in the Value and store it as another variable. I currently have: $(document).ready(function(){ $(:submit[id$='_replace']); var replaceID = $(:submit[id$='_replace']).val; alert (replaceID); return false; }); How about... $(:submit[id$='_replace']).attr(id) Jörn
[jQuery] Re: Problem with jquery.validate.js
Hi all, I'm really getting stuck here, sorry if I haven't made myself clear. I will try and explain briefly: All I want to do is pull the following two things out of the submit button and make them variables: - the content of the ID - the text of the VALUE Here is the line: input type=submit id=sendButton_replace name=send value=Send/ Here is my current code: $(document).ready(function(){ if ( $(:submit[id$='_replace'])) { $.each(function(){ // get the text... var me = $(this), txt = me.text(); // replace the text with constructed html... me.html( [ 'img src=/images/topNav' , txt , '.gif alt=' , txt , ' /' ].join('') ); }); } return false; }); Any help would be greatly appreciated... I mean it! On 27/03/2008, Paul Collins [EMAIL PROTECTED] wrote: Thanks for your help Jörn, that's solved that part of my equation. I'm stuck again! I would like to find out how to get the value of an id that ends in _replace So for instance, I have the following line that looks for a input tag with the type of submit, that has an id ending with _replace. (It can have anything before that). So, for EG: input type=submit id=sendButton_replace value=Send/ I then want to get the entire content of the id and store it into a variable. I would also like to get the text in the Value and store it as another variable. I currently have: $(document).ready(function(){ $(:submit[id$='_replace']); var replaceID = $(:submit[id$='_replace']).val; alert (replaceID); return false; }); On 26/03/2008, Jörn Zaefferer [EMAIL PROTECTED] wrote: Paul Collins schrieb: Hi all, As a follow up to this, I've decided to try and rewrite the image replace script with JQuery, so I can re-use it. The one thing I can't seem to find any info on at the moment is doing a search for only part of an ID. So in this instance, I would like to search for all submit input tags in a form that have an ID ending in _replace. So the ID might be called submit_replace. I would only like to search for the _replace part of any ID in the form. So far I have: $('form').find('#_replace').addClass(_replace); Take a look at: http://docs.jquery.com/Selectors http://docs.jquery.com/Selectors/attributeEndsWith#attributevalue Jörn
[jQuery] Re: Problem with jquery.validate.js
Hi all, As a follow up to this, I've decided to try and rewrite the image replace script with JQuery, so I can re-use it. The one thing I can't seem to find any info on at the moment is doing a search for only part of an ID. So in this instance, I would like to search for all submit input tags in a form that have an ID ending in _replace. So the ID might be called submit_replace. I would only like to search for the _replace part of any ID in the form. So far I have: $('form').find('#_replace').addClass(_replace); Any ideas would be great. Thanks Paul On 26/03/2008, Paul Collins [EMAIL PROTECTED] wrote: Hi all, I'm working with the JQuery validate plugin and having a few problems. I must first point out that I am a novice and may be asking dumb questions! Any tips or links would be great. I have a test page here I am working on: http://paulcollinslondon.com/contactTest.php I am using another script to replace the normal submit button with an image (/javascript/scripts.js). The problem with this is when I use this script it doesn't interact with the JQuery validation and it uses the standard PHP. When I remove the ID (id=sendButton_replace) to call the button script, the validation works fine. If anyone has a moment, would they be able to take a look?! You don't have to give me the answer even, just point me in the right direction. I'm stuck! Thanks for any help. Paul
[jQuery] Re: Problem with jquery.validate.js
Paul Collins schrieb: Hi all, As a follow up to this, I've decided to try and rewrite the image replace script with JQuery, so I can re-use it. The one thing I can't seem to find any info on at the moment is doing a search for only part of an ID. So in this instance, I would like to search for all submit input tags in a form that have an ID ending in _replace. So the ID might be called submit_replace. I would only like to search for the _replace part of any ID in the form. So far I have: $('form').find('#_replace').addClass(_replace); Take a look at: http://docs.jquery.com/Selectors http://docs.jquery.com/Selectors/attributeEndsWith#attributevalue Jörn