Soldato
- Joined
- 12 Feb 2006
- Posts
- 17,645
- Location
- Surrey
i made a quick jquery contact form last night which worked all fine, it simply cancelled the default event, got each input field value, checked not empty, submitted, checked reply, if success then hide form and display thank you message, if not, highlight errors.
i then copied the code for a feedback form, removing the fields i don't need, however it isn't working. I try as much as i can be i just can't see where it's going wrong.
minus a lot of code, this is what i have...
and the alert always comes back blank.
i thought it was perhaps something to do with the fact that the form is initially set as display:none by css so it couldn't then find the #fName field, but i removed that css and it still does it so i'm at the end of what i can try.
anyone any ideas what i can do to find the solution?
i then copied the code for a feedback form, removing the fields i don't need, however it isn't working. I try as much as i can be i just can't see where it's going wrong.
minus a lot of code, this is what i have...
Code:
<div class='label' id='flName'>First Name: </div>
<input type='text' name='fName' id='fName' value=''/>
var fName = $("#fName").val();
alert(fName);
and the alert always comes back blank.
i thought it was perhaps something to do with the fact that the form is initially set as display:none by css so it couldn't then find the #fName field, but i removed that css and it still does it so i'm at the end of what i can try.
anyone any ideas what i can do to find the solution?