•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,769 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,483 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 4253 | Replies: 1
![]() |
•
•
Join Date: Nov 2004
Posts: 12
Reputation:
Rep Power: 4
Solved Threads: 0
I do not know if this is even possible in this language, but here goes:
I am looping a recordset that has been returned for update. the problem is I have many records that can be returned, so when i submit my form, I get an error because it does not know what form elements to use. I used to use this method in coldfusion where I would apply a variable to the end of my form elelmets so they would all be uniquely named, thier form name + the incremt variable so it would give you textbox1 or textbox5.
Now here is the problem. I want to go from the many variables down to a single variable. my plan is to have a function in the on click method that sets the increment to the current row number. I then have a javascript funtion in my onsubmit method that takes this increment to set the single form element = to that value. doe this make sense? can it be done?
here is some sample code
jsIncrement = 0;
this is my on click function where ipass in the variable value and it works //fine
function setIncrement(num){
jsIncrement = num;
}
this is where I wish to set the standard form element = to the dynamic form elelemnt but do not know how...or if it can be done
function selectForUpdateSubmit() {
document.process_form.action.value = "SU";
document.process_form.prod_usage_id.value = document.process_form.upd_prod_usage_id+jsIncrement.value;
document.process_form.submit();
}
any help or suggestions are most appreciated.
I am looping a recordset that has been returned for update. the problem is I have many records that can be returned, so when i submit my form, I get an error because it does not know what form elements to use. I used to use this method in coldfusion where I would apply a variable to the end of my form elelmets so they would all be uniquely named, thier form name + the incremt variable so it would give you textbox1 or textbox5.
Now here is the problem. I want to go from the many variables down to a single variable. my plan is to have a function in the on click method that sets the increment to the current row number. I then have a javascript funtion in my onsubmit method that takes this increment to set the single form element = to that value. doe this make sense? can it be done?
here is some sample code
jsIncrement = 0;
this is my on click function where ipass in the variable value and it works //fine
function setIncrement(num){
jsIncrement = num;
}
this is where I wish to set the standard form element = to the dynamic form elelemnt but do not know how...or if it can be done
function selectForUpdateSubmit() {
document.process_form.action.value = "SU";
document.process_form.prod_usage_id.value = document.process_form.upd_prod_usage_id+jsIncrement.value;
document.process_form.submit();
}
any help or suggestions are most appreciated.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- Fetching Form Values with ASP (ASP)
- What relation does **indirection operator have with Multidimensional Arrays (C++)
- calculator (Java)
- Help in C (C++)
- Hijack problems - Cannot get rid of! (Viruses, Spyware and other Nasties)
- How do I use a pointer variable and pointer arithmatic to display elements of array (C)
- Need help writing a program (C++)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: changing from onclick to onsubmit? possible?
- Next Thread: Javascript help please


Linear Mode