I've fixed my own problem with a hack of a kind. which is a bit
disappointing as I'm not sure what was causing it. I changed the values
called to be 'form#fPollX', in order to pass that straight to the $() jQuery
function and stripped the id value off the end. In order to pass that value
to the function, the function's declared in the bind(), so it's a local
variable.
Terrible I'm sure - if that's bad practice, I'd love to know why.
Cheers,
Dan.
$(document).ready(function(){
initialiseForm("form#fPollX");
initialiseForm("form#fPollY");
});
function initialiseForm(formID) {
if (!document.getElementById) return false;
var theForm = formID.split("#")[1];
if(document.getElementById(theForm)){
$(formID).bind("submit", function post() {
switch(formName){
case "fPollX":
alert('hello X ' + formName);
return false;
break;
case "fPollY":
alert('hello Y ' + formName);
return false;
break;
default:
return false;
}
});
}
}
--
Daniel Eastwell
Portfolio and articles:
http://www.thoughtballoon.co.uk
Blog:
http://www.thoughtballoon.co.uk/blog
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/