Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 2nd, 2005, 04:17 PM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default Posting problem with forms think JS is the answer?

I am having some issues with a form I am trying to build. Essentailly there are 3 parts to this form: Section A, Section B, and Section C.
Within Section A, if someone changes the date in a textbox, then, it need to be submitted back to the page to run the same query with a different date. The results populate Section B. Section C, changes with the change date in Section A, but it can also change with the date from and to in section B. Section C is a dynamically built table this checkboxes that an individual can select to be saved.
I then need a submit button to post all three sections to another page to be saved in the DB. I think I have a problem with my architecture, but here it is.

Section A is a form in and of itself with a onChange event for posting the new date back to the page.

Section B is also a form in and of itself which displays the query results form section A, but here is a catch, the user has to be able to edit any of the text boxes in section B. The user can then also change the from and to dates in section B to change the results of section C.

Section C is a third form which allows the user to select multiple options to be saved in the DB.

Thus, since nested forms is not an option, is there a way to capture the input changes in section B and pass them into the form of Section C so that all of them can be handled on another page accordingly???

I hope you are not as confused as I am!!! Thanks for the help!!!

ps. If anyone actually can respond to this you are SUCH A MAN/WOMAN! WOW!!!!!!
Reply With Quote
  #2 (permalink)  
Old March 3rd, 2005, 04:46 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Should be straight forward. Are you trying to change section C based on section B without any information from B being posted back in between? So if you have a text box in B named "txtDataB" then you can update one in C named "txtDataC" by having an a handler for the onchange event in txtDataB:
Code:
<input type="text" name="txtDataB" onchange="updateFormC(this, 'txtDataC');">

function updateFormC(Sender, TargetName)
{
  var oTarget = document.forms[2].elements[TargetName];
  oTarget.value = Sender.value;
}
--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old March 3rd, 2005, 12:36 PM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think your solution may work, but let me TRY to make this more clear.

Section A (Form #1) is nothing but a date that controls Sections B & C (Forms #2, #3). When the date changes, the information in B & C change accordingly.

Section B (Form #2) is a series of text inputs that have a value returned from the recordset based on the date of Section A (Form #1). Section B (Form #2) also has 2 date text inputs in it (DateRangeFrom and DateRangeTo). These two change according to the date given in Section A (Form #1) and can be manually changed at the users descretion(sp?). If they are changed, then the information in Section C (Form #3) changes accordingly.

Section C is a table that has a series of checkboxes to allow the user to select a particular row to be saved in the database for future reporting or viewing.

All of the information from Section A, B, and C (Forms 1, 2, and 3)then needs to be sent to another page to be saved in various tables to be retrieved later. The problem is that the information changes in Section B are not being captured and sent when the form submit button is press because it is only posting Section C (Form #3) data.
I tried using hidden fields that contain the same data as Section B, but if the user changes the Section B data, it will not update the hidden fields in Section C.
Reply With Quote
  #4 (permalink)  
Old March 4th, 2005, 02:06 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Busher!!

for --> "I tried using hidden fields that contain the same data as Section B, but if the user changes the Section B data, it will not update the hidden fields in Section C."


Write a javascript function that changes the value of hidden form fields on Section C,


Cheers :)

vinod
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Posting XML data via XMLHTTP steelrose XML 1 November 15th, 2007 05:19 PM
Problem with greek characters while posting data f abiprojects Flash (all versions) 2 August 23rd, 2007 09:46 AM
posting form data as XML string problem Cragdo XML 0 July 16th, 2007 10:03 AM
AJAX form posting problem. NisarAhamed Ajax 0 November 21st, 2006 01:09 AM
Problem Posting Reply Ben Horne Forum and Wrox.com Feedback 5 April 14th, 2004 01:56 PM



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


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.