AJAX Forums

Hiding/Showing form elements

This is a discussion on Hiding/Showing form elements within the AJAX Questions forums, part of the Beginners AJAX category; Hi. I'm a beginner who is trying to learn AJAX and use it with a PHP based webiste. I've been struggling with how to accomplish the following: I ...


Go Back   AJAX Forums > Beginners AJAX > AJAX Questions

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Old 06-20-2008, 12:50 PM   #1 (permalink)
Junior Member
 
Join Date: Jun 2008
Posts: 1
Rep Power: 0 jamfitz001 is on a distinguished road
Hiding/Showing form elements

Hi. I'm a beginner who is trying to learn AJAX and use it with a PHP based webiste. I've been struggling with how to accomplish the following:

I would like to have a form where a user enters some info in a field. Before the user can submit, I want to use a captcha security image. After the user submits, I would like to give him the opportunity to upload a file with his post.

I had everything working via standard PHP, but I was not happy with the number of PHP pages that must be loaded and the amount of variables that must be posted and read via the PHP Session to accomplish these step. I wanted everything to occur on a single page to improve the user experience.

My goal was to have:

1. theCaptcha image/input box/enter on a line at the end of my form. The user would match the image and...

2. javascript would then display the submit button. Entering the submit button would validate the form info and write it to my database. Upon successful form completion ...

3. javascript would show the file upload form.

I tried using the PHP script that handled the captcha image to return via echo the submit button to a <p> tag's innerHTML. The button appeared, but it did not function (you could not click on it).

I'm now thinking that all the elements need to be in place during the initial page load, but the submit button and the file upload form need to be in some tags with a display:none state. I then need to change the display state of the tag in my jscript when the httmlrequest is completed.

Can I accomplish what I want to do? Is this the correct way to accomplish what I want? Do I need to append via the DOM model?
jamfitz001 is offline   Reply With Quote
Reply

Bookmarks

Tags
php form displa


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
How do I add elements to an xml document with the php xml dom? John C XML and XSLT 0 11-24-2007 09:17 PM
When parsing XML in PHP how is it possible to skip tag elements that I don't want.? For once please answer. XML and XSLT 0 11-12-2007 03:45 PM
Hiding things with css [kinda complicated, involves injecting javascript]? Eric C XHTML and CSS 0 10-29-2007 10:58 AM
Is it possible to Remove all CSS Elements and Encoding from a Page using Elliot N XHTML and CSS 1 06-23-2007 11:39 AM
When I'm opening my html file, it's showing- "Internet Explorer has... S.Bhattacharjee XHTML and CSS 0 06-01-2007 05:40 PM


All times are GMT -4. The time now is 03:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5
Copyright ©2006 - 2008, AJAXwith.com