2

Is there any way to completely process a form using only javascript & html ? I need to process a form for a school project but using only JS & HTML with no use of cgi scripts, php,… I don’t want anyone to actually make my homework for me, just a pointer in the right direction :)

edit: With processing the form i mean the onSubmit action, submit the info to the administrator either through mail, write it to a file, ... I have already made a script to validate the inputs.

1
  • What do you mean by 'process'? Commented Apr 4, 2012 at 10:01

3 Answers 3

3

Form Processing which I am assuming at the very least will be adding the form data to database and validate ofcourse.

You can validate using jQuery[a js Library] Validate

Also you can post form data using jQuery Ajax

Sign up to request clarification or add additional context in comments.

Comments

0

I assume by 'process' you mean validate. If you are allowed to use a library, use jQuery with its validation plugin

http://docs.jquery.com/Plugins/Validation

Otherwise

var inputs, index, form;

form = document.getElementById('myFormId'); // or form = document.formName
inputs = form.getElementsByTagName('input');
for (index = 0; index < inputs.length; ++index) {
    // deal with inputs[index] element.
}

I hope those can get you started

Comments

0

There aren't any ways to use client-side JavaScript which don't have so many or such serious caveats (such as "IE only and with big security warnings" or "Only if certain email clients are installed") as to make them useless except under very specialised circumstances.

You can use server side JavaScript though. node.js is the current popular choice for that.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.