last day (15 days later) » 

22:47
OK so I know why the validation isn't working. It's because the plugin runs once when the page loads and sets up the hooks for the inputs.
because these inputs do not have the attributes they never get the hooks and the plugin has already run
let me look into the plugin and see if there is a way to load in the inputs after the fact.
@Jambo
Ahaa, that does make sense
add this as the last line to the new code at the bottom of that function.

$('#form').parsley();
basically just re-init the form
hope it is smart enough to handle it'self.
if not we can tear down the form first, then re-init it
$('[name="x_Joint"]').on('change', function() {
    var state     = this.value == 'Yes',
        data_obj1 = {'data-required'      : ( state ? 'true':'' ),
                     'data-error-message' : ( state ? 'Please select your title.' : '') },
        data_obj2 = {'data-required'      : ( state ? 'true':'' ),
                     'data-error-message' : ( state ? 'Valid First Name required.' : '') },
        data_obj3 = {'data-required'      : ( state ? 'true':'' ),
                     'data-error-message' : ( state ? 'Valid Last Name required.' : '') };
it's still super ugly.. but like you said you plan on learning all of this. So I will let you re-visit your own ugly code in 6 months so you can laugh at yourself. we all do it.
The form is ugly as fuck...
HTML is and should be super verbose.
Okay
22:55
js doesn't have to be
by super verbose I mean semantic
9
Q: Semantic HTML5 and proper use of tags

rlemonI'm trying to develop a base for a blog using some of the new tags introduced in HTML5 and I want to not only make sure I'm using them correctly, but my code is also semantic. Here is just the 'sample' document. <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html;c...

see here
I am rlemon.
this username and pic are a joke on this tv show.
Community is an American television comedy series created by Dan Harmon that premiered on September 17, 2009 on NBC. The series follows a group of students at a community college in the fictional locale of Greendale, Colorado. The series heavily uses meta-humor and pop culture references, often parodying film and television clichés and tropes. Community has received acclaim from critics and has gained a cult following. The series was renewed by NBC for a fourth season of 13 episodes. The fourth season, however, is without series creator Dan Harmon as showrunner. The fourth season was sch...
you are knew, so you wouldn't know this :P
Yeah my problem with this site, whilst I have learnt a lot, is that I started with a template, hacked it around a bit, and then have integrated this form which I have changed around and these configuration files for where the details are sent...
It's confusing
Yeah I was wondering about the name haha
My brother studied in the states for a year and watched loads of community
everyone seems to ha
I'm from the UK. He was at the University of Kansas last year
I'm from Ontario, Canada.
I'm actually from a town just south of Cambridge in England, but currently studying at a Uni in Wales
cool.
what are you studying
CS?
Business Management
Nah it was going to be...
22:59
ahh, so CS is just a hobby?
I chose my A levels around the possibility of computer science, but meh
Yeah kinda
thats cool. I don't have a degree. I started as a hobbyist when I was really young and made a career out of it
This summer I want to get up to scratch and really brush up on code. I want have a good understanding of PHP and jQuery, and be proficient in HTML5
Well that's awesome!
That's how the best do it
My degree scheme is rubbish, I hate most of it ha
but I did find that just having a degree gets you opportunities. I headed a SQA department with a lady who had an ECE degree
if you have a little $$ to blow this is an excellent resource to learn to program.
Awesome, I'll make a note!
23:02
I suggest you cough up the $$ for 1 month and take the js course and html5 course and see if it helps you.
Nice one, thanks!
it's sometimes hard to sift through the garbage online to get the good sites for free tutorials.
I have a to-do list for the summer already haha
I suffered through this so much
My exams finish late May then I am good
I haven't started with revising because I have been trying to sort out this damn site
23:03
lol
Yeah i hear ya!
I'll do that, cheers!
did that one line fix the form btw?
once we get that we'll work on the carousel
If I've put it in the right place then i don't think so unfortunately
I've uploaded the new index
also, just as a tip. I assume this is some sort of side job you are doing. if so look into twitter.github.io/bootstrap to help you build things like this without having to pay for templates
Funny you say that! I was reading about bootstrap earlier after speaking to you
I had clicked through somewhere
23:06
it's excellent. If you learn LESS (it's just CSS with a little fancy-ness) you can create VERY customized sites in no time. Fully responsive and all.
however out of the box you can still prototype with it
Awesome! Making notes in Wunderlist hah
example of a bootstrap site I did from a free bootstrap template :P rlemon.github.io/so-chat-javascript-rules
content needs updating.. I kinda hoped the rest of the JS community here would contribute but they just left it to me :P
switch
});
$('#form').parsley();

to

$('#form').parsley();
});
you want that triggered on click
Awesome! definitely going to look into bootstrap
that's cool
Unfortunately still doesn't work :(
I honestly didn't even know it would be possible to add/remove attributes from an element like this before.
I was wondering how on earth I would get it done
ok, so I have a fix for the validation but it will require you give all of the elements in the 'partner' form an id.
Sure
23:14
so just duplicate the name for the ID
Just the ones that need validating right?
yes just the ones that need validating
ie First Name, Last Name and the three option selections
	var frm = $( '#form' );
	frm.parsley( 'addItem', '#x_C2Title' )
	   .parsley( 'addItem', '#x_C2Forename' )
	   .parsley( 'addItem', '#x_C2Surname' )
	   .parsley( 'addItem', '#x_C2DOB_day' )
	   .parsley( 'addItem', '#x_C2DOB_month' )
	   .parsley( 'addItem', '#x_C2DOB_year' )
you need this code to work.
so every item with the name that corresponds to those ID's needs to have an ID the same as it's name
and that block of code replaces $('#form').parsley();
if for whatever reason it does not work just add a ; to each line and frm before each .parsley
basically if that is the case it means the plugin is shitty and doesn't return the object it is mutating
okay, i just need to change a couple of ids to classes
haha
23:19
jQuery plugins should chain. some do not. the philosophy is they should. so idk if this one does.
Okay I've added classes and uploaded the code
I think I'll have to try it with the semicolons
hmm...
lol you didn't change the ID's and you mucked up the js a little
the eff
ah i have to upload the form file
sorry ha
23:26
hehe
the form is split across files...
this site is a bitch...
and remove the spaces from the frm .parsley
there shouldn't be a space between frm and .parsley
Fixed
Well I say that, you never know
wtf.
ok this should work according to their docs
hmm :/
23:31
crap
you are using the latest version of this plugin yes?
I wouldn't know what to do, completely lost :/
I only added it a couple of days ago so I assume so yeah
erm
ok yea you are
yeah just checked
looks like it is a crap plugin
that sucks
ah shit!
23:35
two solutions here: you can validate field by field yourself and not rely on the attribute pickup (bit of code but not that hard) or you can find a new plugin
There is already server-side validation for those fields but I wanted to do everything I could to maximise the conversion of the form submission. For example providing the top part of the form is all filled out, and the first option box is changed, the user will be shown errors field by field
Maybe I'll just have to rely on this after all, and hope that people won't change the option and leave fields blank
you can rely on pure HTML5 validation
this will only catch modern browsers but like you said server already validates
It's just annoying how the server validates it. The form I built this around is kinda old. But it only validates field by field.
It's one of those things I guess. I'm a bit of a perfectionist but if not many people run into it then it shouldn't look too bad
yea well when PHP is concerned I used to do it all myself now I use frameworks like Symphony or CodeIgniter
Do you think there is a better way to do it in PHP perhaps?
if option selected, assign variables with attributes, if not selected assign variable as empty?
that kinda thing
why didn't i try that before...
it would probably still take me a while to figure out
i've been stuck on this one thing since sunday night
23:49
yea learning to program can be a bitch sometimes
idk, personally I don't like PHP although I have used it for many years
again, which is why I use frameworks to reduce the hastle
Something I definitely need to look into!
ah what a pain eh
this is a single page thing yes?
correct
ok well look at ellislab.com/codeigniter
you might be able to redo the back end in a day or so
saying that, it's quite confusing due to the way the form works
I didn't create the original form, the data goes to a database and those guys make the forms.
So for this site I can't really control the structure
BUT, if I can completely re-do it at some point I definitely will!
23:52
most php guys dislike CI but I like it because it's simple
truth be told I don't write web for work :P
just as a hobby
I'm thinking that I should learn to write web more and more...
I get by with the absolute basics
once you get into it you'll see it's really powerful
To be fair I don't think the form looks too bad. Nobody is going to visit the site and leave loads of empty fields
if they leave a couple for the main part of the application, the parsley script will show them in a fairly nice way what to do
and if they are completely idiotic the server-side won't perhaps appear as pretty but will hopefully work
no the form looks fine
here, if you are new to web check this out. here is some experiments I have done. And I am by no means the person to be looking at for "cool shit"
haha
oo interesting!
that's awesome
all frontend stuff.
it's really cool once you get into it
I definitely need to spend more time looking into it
23:58
somethinghitme.com this is a user named Loktar
I'll have to remember your name and after my exams learn some more and visit the chats more
lol remember rlemon.
this name will go away
stupid StackOverflow. meant to be a one day joke. turns out you have to keep usernames for a month
hahaha!
yea yea, jokes on me :P I realize it
Yes Kevin
23:59
lol
Kevin just reminds me of youtube.com/watch?v=UlzoL-wQwio
Every time I hear the name now

  last day (15 days later) »