I'm not that good with javascript so i need some help on it.
Basically i would like to write a function that ..
Well, i'm creating a webpage, it has a guestbook and when users fill in the details
(anyone knows how to do the validation function?)
and click submit, the submit button 'grabs' the function from the cookie
(cookie to emulate a sucessful submission e.g. from a server)
and displays a page something like, You have sucessfully submitted!
Your details are as follows ...
Name:xxx
all the other details : xxx
If you guys arent clear about anything just ask.
Thanks !
some questions. why do you need a cookie to display successful submission? and you want client-side validation or server-side validation?
It has been some times since I touched javascript.. iirc, the validation is a functions where the form runs upon submit. The function will initiate an error msg as a blank string, then check for the various fields for errors. If error exists then it adds a specific message to the empty string. At last, the string message is called upon using an alert button function to display the errors to the users.. sth like that..
That's what I learned few years back in poly.. not sure if they use the same method now... Hope it helps...
google it...
Hey everyone!
I played around with JavaScript and i've kinda got what i wanted.
But i'm not sure about how to write the function to open a certain .html page after i click submit. onSubmit..?
var OpenWindow=window.open("", "newwin");
my current one is *above*
it opens in a new window but i want my own .html page.
Originally posted by 93'guy:Hey everyone!
I played around with JavaScript and i've kinda got what i wanted.
But i'm not sure about how to write the function to open a certain .html page after i click submit. onSubmit..?
var OpenWindow=window.open("", "newwin");
my current one is *above*
it opens in a new window but i want my own .html page.
Originally posted by 93'guy:Hey everyone!
I played around with JavaScript and i've kinda got what i wanted.
But i'm not sure about how to write the function to open a certain .html page after i click submit. onSubmit..?
var OpenWindow=window.open("", "newwin");
my current one is *above*
it opens in a new window but i want my own .html page.
onsubmit works fine.
http://lx.sg/null/sgf402268.html
Ctrl+U to view source. (I'm assuming you're not using IE.)
If you find yourself frequently accessing the DOM (eg. getting values from form fields), I would suggest picking up jQuery for its simple yet powerful element selector.
Cool, thanks.
I've got almost everything up and running.
The only problem is that it doesnt validate
---
EDIT.
EVERYTHING IS UP AND RUNNING FINE.
turns out i didnt corrently write the code in my form.
Thanks everyone!~