lol, dude on JSFiddle? The old one is still showing all of the stuff I was asking you to take out.
lol sorry Pullo, blinking heck munā¦
I just clicked āUpdateā, is that it
Think I got it - https://jsfiddle.net/accend4web/m2znc8a6/4/
Sweet. Weāre getting there. The URL for jQuery validation is wrong though (you can see this in the console). Please use a CDN or something.
Do you mean in jsfiddle or my site?
JSFiddle
Duuude. Go to that page, open the console and fix the errors
I think if you where close by with my next sentence i think Id say it and run lol.
I cant see any errors in jsfiddle, there nothing standing out that i can see in any of the consoles, and I cant work out what your meaning, Im really sorry man
lol, no worries.
Go here: https://jsfiddle.net/accend4web/m2znc8a6/7/
Press āF12ā and click āConsoleā (this works in Chrome)
Which browser are you using? What do you see?
I see:
Hi Pullo, your favourite nightmare is back to it, I had to jump off this to sort something else out but will need your support if you dont mind to get this finished. I left it and couldnt work out the errors, but will go back and make a new start. Thanks for everything so far
What i dont get is that its showing a 404 and I added these files into external resources. Do I have to upload these files to a certain like media folder and then reference them in external resources
When you add external resources to a fiddle, you need to input a full URL to the file you want to be loaded. For example, if you look at the Bootstrap website you can get the CDN link for their JS file: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js
Ah I see, have added them in but then got an error on the jquery validator I think, but its a step forward, and at least I know now
Your link to jQuery is still broken
Ok think I sorted that now, when i cleared the errors, and ran it again i can only see 1 error
SyntaxError: expected expression, got ā}ā
So will try and hunt that down
Itās not hard. Click the file in which the error message appears (on the right of the message itself, so fiddle.jshell.net/:338
) and you will be taken to the error.
This is why Iām looking silly, Iām looking in the JavaScript panel and I cant see that last bracket, its not there.
I see this as the last couple of lines
$.ajax(
{
});
};
And Iām not sure how to work JSFiddle sorry, so I dont know what to click and work my way around to these different pages.
And the errorr is showing
$.ajax(
{
});
};
}//]]>
So thats why when I went through the open and closed brackets I couldnt see it.
Iāve got it on the live server now too, a copy of what Im doing
By calling $("#signupForm").validate({ ... });
youāre initializing the validation library for that form - the validation will only run once the form is submitted, so you donāt need to wrap your code in a function (i.e. serviceCall()
).
However, the validation wonāt be triggered, because the form is not being submitted. Hereās the current code youāre using for the button:
<div id="buttonSubmit" onclick="serviceCall();">SUBMIT</div>
Youād be better off using a proper <button>
element, as thatāll submit the form (triggering validation) and also improve the usability/accessibility of the form - currently thereās no way to submit the form via keyboard, as you canāt tab to the button.
Ok so I can take the validation code from
$("#signupForm").validate({
And put it ouside the serviceCall() function in its own script tags.
Then change
<div id="buttonSubmit" onclick="serviceCall();">SUBMIT</div>
To Iām guessing something like
<button type="button" onclick="serviceCall();">Submit</button>
Ive just updated the file on the live site with my changes, the button works fine, but the validation isnt.
Yeah, and then you no longer need to set the onclick attribute on the button either.
One other thing - I notice you have an $.ajax()
call within the function, to submit the form data. Youāll need to initiate that with a submitHandler
function that you pass to the validation library.
Have a look at the example here, to see how to set that option.