Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiples form within one page

Status
Not open for further replies.

akaballa123

Technical User
Apr 29, 2008
46
US
Hi There,

I have two forms in a website. When a user is filling in Form A and finds that a certain value is not found within one of the form select fields, then the user has to add that value through form B. I would like to open a Form B within the page when a user clicks a link to form B. Basically, i want to do this so that I do not have to save the current Form A's variables and then re-display them after user completes Form B. If this does not work, if there a way where I can pop-up Form B in a different window and simultaneouly refresh Form A as soon as form B is submitted? Please let me know!

Thanks!
 
You can do it either way. I would not use a popup... make the form B show inline.

This is hardly an AJAX question.

If you have any issues actually implementing your solution, please direct them to the forum216

Regards,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Lets be clear on what you have so far and what you want.
My interpretation:
The select field A is populated via a database lookup.
If the database does not hold the desired value you want to let the user insert into the table an appropriate value via form B and then have that value appear in select A ?

If so yes that is possible. There are no inherent limits to how many ajax functions there can be on a page.

Please explain what you want in detail.
 
Ye that is what I want,

Basically, I have two forms in my website. One form is for users to register for trainings of particular courses. The other form is an "add new course" form for adding courses that the user can register for. In the trainings form, these are my main fields:

Code:
Name:

Course Name (drop down list)

course Instructor (drop down list)

start/end date:

Each course can have multiple course instructors, so I created a separate course Instructors field where it shows the relavant instructors for a particualr course.


Basically, if a user is filling in the Training form and realizes the "Course Name" drop down list does not contain his course, then he should be able to go to the "Add New Course" form add his new course, and come back to his currrent training form with all the other field values intact, and the Course Name drop down list and course Instructor drop down list updated with the new information.

On a side note, I submitted my forms to a separate summary page where the values will be inserted into a DB.

I am using php as my server side script.

Here is the form code for course name and course instructor. I have also highlighted the link to the "Add new course" form.

Code:
<p><label>* Course Name</label> <select name="training" id="training" onclick="display_course_instructor(this.value);">
<b><!--<option value="select" style="color: blue; font-weight: bold;">Course Name</option>--></b>

<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<?php
//fetch course name and course instructor for courses table and display as options
//use '<<' as delimiter.
while ($row = mysql_fetch_array($result)) {
 echo '<option >' . $row['courseName'] . '</option>';
 }
?></select> <span>&nbsp;&nbsp;  [highlight]<!--<a href="javascript:void(0);" onclick="loadAddCourse();">Add New Course </a>-->[/hihglight] Course Name
</span></p>

hopefully, I have given you sufficient information. Any help would be much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top