/    Sign up×
Community /Pin to ProfileBookmark

Form/Comment box help

Hi, I am new to javascript and need some help. Basically this is a one page site, with a simple form, an empty comment box underneath, then under that a submit button.

I need to write a code where the user fills out a form with drop down menus and a couple text fields. Then the user would click the submit button. Once submitted, the information that the user filled out would appear on the same page as the form in the comment box, but with the text “Thank you for your input, here is your information:” before the info they filled out.

My problem is I cannot create a function to make the information appear in the comment box. It keeps showing up on a new page.

Thank you! I am new and would really appreciate the help 😮

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinMar 08.2007 — yes, it will show on a new page because you have a submit button and are therefore submitting the page.

you either need to redirect the page back to where it came from, or ideally use javascript to do whatever you want with the data so that you never need to leave the page.
Copy linkTweet thisAlerts:
@yitzleMar 08.2007 — You need to use a server side script like PHP,Perl,ASP to add the data to the file on the server. Search for Guestbook
Copy linkTweet thisAlerts:
@kroseauthorMar 08.2007 — how about instead of a submit button, I would have the information from the form automatically appear inside the text box, and then if the user would decide to change the form it would automatically update? Would that work, or is that possible?
Copy linkTweet thisAlerts:
@CrazyMerlinMar 08.2007 — anything is possible. The main question is where you want the information to end up in the end.

I assume you want the form to display, the user to fill it in, click a button and the info they entered is displayed in the text box at the bottom for editing if they want to.

They would then be able to edit the info or submit it.

Is that what you want?

And once the data is good what happens to it?
Copy linkTweet thisAlerts:
@kroseauthorMar 08.2007 — ok, sorry for the confusion, but I changed what I wanted just a little hoping to make it easier for me. I keep reading ways to do this and get more and more lost, so I have created a little (and very quick) image to display basically what i want (see attached). So when looking at the image, if the user wants to change the form, it would auto update in the text box below. Once they are satisfied, they can submit the form and it will be sent to me or saved for themselves.

I hope this isn't too difficult to do, because my brain is going numb from javascript overload!

[upl-file uuid=edfc407a-714e-4188-8751-d2abd7563090 size=22kB]form2.JPG[/upl-file]
×

Success!

Help @krose spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...