Results 1 to 2 of 2

Thread: Create Form using Javascript

  1. #1
    Join Date
    Nov 2011

    Exclamation Create Form using Javascript

    How to create forms, like survey forms using javascript. I cannot ask all my questions at once as they differ according to user's answer. The tutorials and examples I found on the web are more to how to check whether user's inputs are within numbers for the "phone", which is not useful for my case.

    My form is simple, the user will only submit an answer to every question, although there will be a few options given. Currently i am thinking of creating buttons with options on it and the user can click on the desired answer.

    Then the page needs to refresh to the next question (as mentioned earlier, the question depends on the user's answer to previous question. There will be no true or false answer.

    What i have done currently is up to :
    ask question 1, and created yes, no and maybe buttons, and different messages will appear in a pop up window according to user's answer. This is NOT what I want, i want the page to refresh and proceed to next question instead of having pop ups. as I mentioned, there is no true and false answer. Every answer by the user is like a command to what question should be called next.

    I appreciate it if you could show me some example codes.

  2. #2
    Join Date
    Nov 2011
    on the "onclick" event of option box (where you have set your alerts), set form action and submit your form.

    form1.action ="page1.html"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center