javascript.
i had a code like this, which add a rows in a table, with an inputtext and a button in each row. i want to know how will i do this scenario:
that when i add 5 'tdOrdersSerial' and 5 'tdOrdersMobile', when i clicked button added in each 'tdOrdersMobile' the value in the input text will auto populate in the 'tdOrdersSerial' (index 0 to index5, index 2 - index 6, etc.). and when i add another 5 'tdOrdersSerial' and 5 'tdOrdersMobile' the values in the first batch will not be removed,.
please help,. im stucked for a long time. :(
Thanks and regards - tdElementSet1 = document.createElement('td');
-
tdElementSet1.id = 'tdOrdersSerial';
-
tdElementSet1.innerHTML = ' ' + varSerialNo + '<input type="hidden" name="hdnOrdersSerialNo" value="' + varSerialNo + '">';
-
+ '<input type="button" name="btnItemDetail" id="btnItemDetail" onClick="getSerializedHandsetLOV()>'
-
trElementSet1.appendChild(tdElementSet1);
-
-
tdElementSet1 = document.createElement('td');
-
tdElementSet1.id = 'tdOrdersMobile';
-
tdElementSet1.innerHTML = ' ' + varMobileNo + '<input type="hidden" name="hdnOrdersMobileNo" value="' + varMobileNo + '">';
-
+ '<input type="button" name="btnItemDetails" id="btnItemDetails" onClick="getSerializedSimLOV()>'
42 2486
javascript.
i had a code like this, which add a rows in a table, with an inputtext and a button in each row. i want to know how will i do this scenario:
that when i add 5 'tdOrdersSerial' and 5 'tdOrdersMobile', when i clicked button added in each 'tdOrdersMobile' the value in the input text will auto populate in the 'tdOrdersSerial' (index 0 to index5, index 2 - index 6, etc.). and when i add another 5 'tdOrdersSerial' and 5 'tdOrdersMobile' the values in the first batch will not be removed,.
please help,. im stucked for a long time. :(
Thanks and regards - tdElementSet1 = document.createElement('td');
-
tdElementSet1.id = 'tdOrdersSerial';
-
tdElementSet1.innerHTML = ' ' + varSerialNo + '<input type="hidden" name="hdnOrdersSerialNo" value="' + varSerialNo + '">';
-
+ '<input type="button" name="btnItemDetail" id="btnItemDetail" onClick="getSerializedHandsetLOV()>'
-
trElementSet1.appendChild(tdElementSet1);
-
-
tdElementSet1 = document.createElement('td');
-
tdElementSet1.id = 'tdOrdersMobile';
-
tdElementSet1.innerHTML = ' ' + varMobileNo + '<input type="hidden" name="hdnOrdersMobileNo" value="' + varMobileNo + '">';
-
+ '<input type="button" name="btnItemDetails" id="btnItemDetails" onClick="getSerializedSimLOV()>'
Now what error you are getting ?
Debasis Jana
Now what error you are getting ?
Debasis Jana
i had no idea how to implement it. :(
i had no idea how to implement it. :(
Please Clarify me here.
"(index 0 to index5, index 2 - index 6, etc.)"
What does that mean?
Debasis Jana
Now what error you are getting ?
Debasis Jana
i had no idea how to implement it. :(
i had no idea how to implement it. :(
You already had your Code ...
What is this .... "i had no idea how to implement it"?
And please tell me the "Indexing System"
Debasis Jana.
i had no idea how to implement it. :(
ex.
tdOrdersSerial [0]
tdOrdersSerial [1]
tdOrdersSerial [2]
tdOrdersMobile [3]
tdOrdersMobile [4]
tdOrdersMobile [5]
when button on 5 is clicked, the value will be on 2
when 4, value will be in 2
javascript.
i had a code like this, which add a rows in a table, with an inputtext and a button in each row. i want to know how will i do this scenario:
that when i add 5 'tdOrdersSerial' and 5 'tdOrdersMobile', when i clicked button added in each 'tdOrdersMobile' the value in the input text will auto populate in the 'tdOrdersSerial' (index 0 to index5, index 2 - index 6, etc.). and when i add another 5 'tdOrdersSerial' and 5 'tdOrdersMobile' the values in the first batch will not be removed,.
please help,. im stucked for a long time. :(
Thanks and regards - tdElementSet1 = document.createElement('td');
-
tdElementSet1.id = 'tdOrdersSerial';
-
tdElementSet1.innerHTML = ' ' + varSerialNo + '<input type="hidden" name="hdnOrdersSerialNo" value="' + varSerialNo + '">';
-
+ '<input type="button" name="btnItemDetail" id="btnItemDetail" onClick="getSerializedHandsetLOV()>'
-
trElementSet1.appendChild(tdElementSet1);
-
-
tdElementSet1 = document.createElement('td');
-
tdElementSet1.id = 'tdOrdersMobile';
-
tdElementSet1.innerHTML = ' ' + varMobileNo + '<input type="hidden" name="hdnOrdersMobileNo" value="' + varMobileNo + '">';
-
+ '<input type="button" name="btnItemDetails" id="btnItemDetails" onClick="getSerializedSimLOV()>'
"when 4, value will be in 2" it will be most probably ...... "when 4, value will be in 1"
So you need the code of "getSerializedSimLOV()" function.
One more thing "Smiley22", that is try to have unique "ID".
So you have some rows of "Serial Number" and "Mobial Number".
Now you want these corresponding two values when a button clicked.
Right?
Assuming this I am trying to implement your Code. -
<input type="button" name="btnItemDetails" id="btnItemDetails" onClick="getSerializedSimLOV(this)>
-
-
function getSerializedSimLOV(obj)
-
{
-
var row = obj.parentNode.parentNode.rowIndex;
-
var serials = document.getElementsByNames("hdnOrdersSerialNo");
-
var mobiles = document.getElementsByNames("hdnOrdersMobileNo");
-
alert("Serial: " + serials[row-1] + "\t" + "Mobile: " + mobiles[row-1]);
-
}
-
Have a try with this.
Good Luck !
Debasis Jana
"when 4, value will be in 2" it will be most probably ...... "when 4, value will be in 1"
So you need the code of "getSerializedSimLOV()" function.
One more thing "Smiley22", that is try to have unique "ID".
So you have some rows of "Serial Number" and "Mobial Number".
Now you want these corresponding two values when a button clicked.
Right?
Assuming this I am trying to implement your Code. -
<input type="button" name="btnItemDetails" id="btnItemDetails" onClick="getSerializedSimLOV(this)>
-
-
function getSerializedSimLOV(obj)
-
{
-
var row = obj.parentNode.parentNode.rowIndex;
-
var serials = document.getElementsByNames("hdnOrdersSerialNo");
-
var mobiles = document.getElementsByNames("hdnOrdersMobileNo");
-
alert("Serial: " + serials[row-1] + "\t" + "Mobile: " + mobiles[row-1]);
-
}
-
Have a try with this.
Good Luck !
Debasis Jana
yeah, when 4 its 1, oh im wrong again. sorry ok i'll try this..
thanks :)
yeah, when 4 its 1, oh im wrong again. sorry ok i'll try this..
thanks :)
im getting an error here:
var serials = document.crmForm.getElementsByNames("hdnOrdersSeri alNo");
var mobiles = document.crmForm.getElementsByNames("hdnOrdersMobi leNo");
alert("Serial: " + serials[row-1] + "\t" + "Mobile: " + mobiles[row-1]);
object doesn't support this property or method :(
im getting an error here:
var serials = document.crmForm.getElementsByNames("hdnOrdersSeri alNo");
var mobiles = document.crmForm.getElementsByNames("hdnOrdersMobi leNo");
alert("Serial: " + serials[row-1] + "\t" + "Mobile: " + mobiles[row-1]);
object doesn't support this property or method :(
Did you check my Code?
"document.crmForm" who told you to add "crmForm" with "document"?
It will be only "document.get....".
Debasis Jana.
Did you check my Code?
"document.crmForm" who told you to add "crmForm" with "document"?
It will be only "document.get....".
Debasis Jana.
ah yeah, i also used that code without crmForm.. but the error was the same.
ah yeah, i also used that code without crmForm.. but the error was the same.
Oho.........Sorry !
It will be "..ByName" instead of "..ByNames".
Got me.
Do it ... and let me know.
Debasis Jana
Oho.........Sorry !
It will be "..ByName" instead of "..ByNames".
Got me.
Do it ... and let me know.
Debasis Jana
the error was resolve,
but the alert serial and mobile was undefined..
the error was resolve,
but the alert serial and mobile was undefined..
Alert the varibale "row";
See what outputs it.
And make sure that it returns proper Row Index.
And check out the generated HTML code, how much HTML elements by name "hdnOrdersSerialNo" and "hdnOrdersMobileNo".
Then tell me all these things.
Debasis Jana
Alert the varibale "row";
See what outputs it.
And make sure that it returns proper Row Index.
And check out the generated HTML code, how much HTML elements by name "hdnOrdersSerialNo" and "hdnOrdersMobileNo".
Then tell me all these things.
Debasis Jana
i only get 0(zero) rows.......
i only get 0(zero) rows.......
ok....Now send me the generated HTML code.
And also JavaScript Code.
Debasis Jana
ok....Now send me the generated HTML code.
And also JavaScript Code.
Debasis Jana
but its too long ;( how will i send i only send a little part of it, because i want to get idea from you guys, coz i really not familiar with that code
but its too long ;( how will i send i only send a little part of it, because i want to get idea from you guys, coz i really not familiar with that code
function getSerializedSimLOV1(obj)
{
var row = obj.parentNode.parentNode.rowIndex;
var serials = document.getElementsByName("hdnOrdersSerialNo");
var mobiles = document.getElementsByName("hdnOrdersMobileNo");
alert('row' + row);
alert("Serial: " + serials[row-1] + "\t" + "Mobile: " + mobiles[row-1]);
}
but its too long ;( how will i send i only send a little part of it, because i want to get idea from you guys, coz i really not familiar with that code
Part by Part send me ......
Debasis Jana
Sorry "Smilly" it's tough to analyze your Code.
Let me know one thing, are you inserting a table inside a table "TD"?
And what is this "varGlobalRowCounter" ?
Debasis Jana
Sorry "Smilly" it's tough to analyze your Code.
Let me know one thing, are you inserting a table inside a table "TD"?
And what is this "varGlobalRowCounter" ?
Debasis Jana
:(
the code inserts a row in a table together with its column..
varGlobalCounter??i used it in other functionality of my program
"when 4, value will be in 2" it will be most probably ...... "when 4, value will be in 1"
So you need the code of "getSerializedSimLOV()" function.
One more thing "Smiley22", that is try to have unique "ID".
So you have some rows of "Serial Number" and "Mobial Number".
Now you want these corresponding two values when a button clicked.
Right?
Assuming this I am trying to implement your Code. -
<input type="button" name="btnItemDetails" id="btnItemDetails" onClick="getSerializedSimLOV(this)>
-
-
function getSerializedSimLOV(obj)
-
{
-
var row = obj.parentNode.parentNode.rowIndex;
-
var serials = document.getElementsByNames("hdnOrdersSerialNo");
-
var mobiles = document.getElementsByNames("hdnOrdersMobileNo");
-
alert("Serial: " + serials[row-1] + "\t" + "Mobile: " + mobiles[row-1]);
-
}
-
Have a try with this.
Good Luck !
Debasis Jana
Hey I got that. -
alert("Serial: " + serials[row] + "\t" + "Mobile: " + mobiles[row]);
-
Make this changes, you will get the result.
Debasis Jana
Hey I got that. -
alert("Serial: " + serials[row] + "\t" + "Mobile: " + mobiles[row]);
-
Make this changes, you will get the result.
Debasis Jana
its alerts as an object.. serials[object], mobiles[object]
its alerts as an object.. serials[object], mobiles[object]
Then simply access it's attributes ........... buddy :)
Actually you are getting perfect object, what you need for then access their properties using "." operator.
Debasis Jana
Then simply access it's attributes ........... buddy :)
Actually you are getting perfect object, what you need for then access their properties using "." operator.
Debasis Jana
aaaahhh, ok, still not clear what to do
aaaahhh, ok, still not clear what to do
Ok.............Now you tell me, what do you want from that function.
Actually what is the job to be done by that function.
Tell me carefully.
Debasis Jana
Ok.............Now you tell me, what do you want from that function.
Actually what is the job to be done by that function.
Tell me carefully.
Debasis Jana
the function should married the mobile nos.
ex. when you add 5 handset and 5 sim, each has a mobile no.
the control is in the sims button when you clicked the 6th row which is the first sim there is a value that is retrived by one of my function, then after that, the value should be auto populate in the mobile of the first handset..and then the 7th row which is the second sim in the table..should auto populate the mobile to the second handset etc...
its like they are being married by the mobile no., so sceneario can be
1st marrying - 5 handset, 5 sim
2nd marrying(can be possible) 4 handset, 4 sim
the function should know how to pair the entry in the table..
the function should married the mobile nos.
ex. when you add 5 handset and 5 sim, each has a mobile no.
the control is in the sims button when you clicked the 6th row which is the first sim there is a value that is retrived by one of my function, then after that, the value should be auto populate in the mobile of the first handset..and then the 7th row which is the second sim in the table..should auto populate the mobile to the second handset etc...
its like they are being married by the mobile no., so sceneario can be
1st marrying - 5 handset, 5 sim
2nd marrying(can be possible) 4 handset, 4 sim
the function should know how to pair the entry in the table..
---
i had a variable that determines that the item added to table is either a handset or sim its the - hdnOrdersMainCategoryCode
im confused how to group the items and paired them their corresponding min.
the function should married the mobile nos.
ex. when you add 5 handset and 5 sim, each has a mobile no.
the control is in the sims button when you clicked the 6th row which is the first sim there is a value that is retrived by one of my function, then after that, the value should be auto populate in the mobile of the first handset..and then the 7th row which is the second sim in the table..should auto populate the mobile to the second handset etc...
its like they are being married by the mobile no., so sceneario can be
1st marrying - 5 handset, 5 sim
2nd marrying(can be possible) 4 handset, 4 sim
the function should know how to pair the entry in the table..
Well !
So you need to click on row which is greater than 5th row. -
function getSerializedSimLOV(obj)
-
{
-
var row = obj.parentNode.parentNode.rowIndex;
-
var serials = document.getElementsByNames("hdnOrdersSerialNo");
-
var mobiles = document.getElementsByNames("hdnOrdersMobileNo");
-
if(row>4)
-
alert("Serial: " + serials[row-5].value + "\t" + "Mobile: " + mobiles[row-5].value);
-
else alert("Select the proper row");
-
}
-
Debasis Jana
Well !
So you need to click on row which is greater than 5th row. -
function getSerializedSimLOV(obj)
-
{
-
var row = obj.parentNode.parentNode.rowIndex;
-
var serials = document.getElementsByNames("hdnOrdersSerialNo");
-
var mobiles = document.getElementsByNames("hdnOrdersMobileNo");
-
if(row>4)
-
alert("Serial: " + serials[row-5].value + "\t" + "Mobile: " + mobiles[row-5].value);
-
else alert("Select the proper row");
-
}
-
Debasis Jana
but how about when there are
3 handsets 3 sims
3 handsets 3 sims
3 handsets 3 sims
how will i paired it..
but how about when there are
3 handsets 3 sims
3 handsets 3 sims
3 handsets 3 sims
how will i paired it..
Means if the on 6th row it is clicked then first row will be populated.
And if it is clicked on first row then, what?
Debasis Jana
Means if the on 6th row it is clicked then first row will be populated.
And if it is clicked on first row then, what?
Debasis Jana
function only is placed in the sim part.. when you clicked the12th row
the value wil be in 7th row, when you clicked the 18th row, the value will be in 13th row.
function only is placed in the sim part.. when you clicked the12th row
the value wil be in 7th row, when you clicked the 18th row, the value will be in 13th row.
Yeah I did that.
Hello ... Look at my code buddy.
12-5=7
13-5=8
.
.
18-5=13
Have a careful look.
Debasis Jana
Yeah I did that.
Hello ... Look at my code buddy.
12-5=7
13-5=8
.
.
18-5=13
Have a careful look.
Debasis Jana
this code??what if row is >3?
function getSerializedSimLOV(obj)
{
var row = obj.parentNode.parentNode.rowIndex;
var serials = document.getElementsByNames("hdnOrdersSerialNo");
var mobiles = document.getElementsByNames("hdnOrdersMobileNo");
if(row>4)
alert("Serial: " + serials[row-5].value + "\t" + "Mobile: " + mobiles[row-5].value);
else alert("Select the proper row");
}
this code??what if row is >3?
function getSerializedSimLOV(obj)
{
var row = obj.parentNode.parentNode.rowIndex;
var serials = document.getElementsByNames("hdnOrdersSerialNo");
var mobiles = document.getElementsByNames("hdnOrdersMobileNo");
if(row>4)
alert("Serial: " + serials[row-5].value + "\t" + "Mobile: " + mobiles[row-5].value);
else alert("Select the proper row");
}
Ahh ... Let me clear one thing ....Smiley.
Your click will start from 6th row, right?
So if row clicked before 6th then it ll alert a message... "Select the proper row".
Here the thing done !
Debasis Jana
Ahh ... Let me clear one thing ....Smiley.
Your click will start from 6th row, right?
So if row clicked before 6th then it ll alert a message... "Select the proper row".
Here the thing done !
Debasis Jana
Hi, i had came up with this code - function getSerializedSimLOV1(obj) {
-
-
var varQuantityValue = document.crmForm.txtQuan.value;
-
varQuantityValue = parseInt(varQuantityValue);
-
var ctr = 0;
-
var varRowCount = document.getElementById('tblOrders').rows.length;
-
var handsetCounter = 0;
-
var simCounter = 0;
-
var varTemp = 0;
-
var z = 0;
-
-
var row = obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rowIndex;
-
var mobiles = document.getElementsByName("hdnMIN");
-
-
if (varRowCount > 1) {
-
for (ctr = 0; ctr<varRowCount; ctr++) {
-
var varMainCategoryCode = document.crmForm.hdnOrdersMainCategoryCode[z].value;
-
-
if (varMainCategoryCode == "HANDSET" ){
-
handsetCounter++;
-
}
-
-
z++;
-
}
-
-
varTemp = row - handsetCounter;
-
-
document.crmForm.hdnMIN[varTemp].value = mobiles[row].value;
-
}
-
}
-
this works for the first pair only,..
example:
when i add :
pair 1 - 1 handset 1sim
pair 2 - 1 handset 1 sim
pair 1 is good, it populate the pair handset 1
but when in pair 2, when i clicked sim 1 the value populated in pair 1 sim 1,
which should be in pair 2 handset 1....
Thanks for your help...
Well !
Please use Code tags.
Please explain me this code .. -
if (varRowCount > 1) {
-
for (ctr = 0; ctr<varRowCount; ctr++) {
-
var varMainCategoryCode = document.crmForm.hdnOrdersMainCategoryCode[z].value;
-
-
if (varMainCategoryCode == "HANDSET" ){
-
handsetCounter++;
-
}
-
-
z++;
-
}
-
-
varTemp = row - handsetCounter;
-
What is the purpose of it?
Debasis Jana
Well !
Please use Code tags.
Please explain me this code .. -
if (varRowCount > 1) {
-
for (ctr = 0; ctr<varRowCount; ctr++) {
-
var varMainCategoryCode = document.crmForm.hdnOrdersMainCategoryCode[z].value;
-
-
if (varMainCategoryCode == "HANDSET" ){
-
handsetCounter++;
-
}
-
-
z++;
-
}
-
-
varTemp = row - handsetCounter;
-
What is the purpose of it?
Debasis Jana
to get the row where the auto populate value will be place.
pair 1 is good, it populate the pair handset 1
but when in pair 2, when i clicked sim 1 the value populated in pair 1 sim 1,
which should be in pair 2 handset 1....
Actually I am not getting your point here.
Please explain me little bit more.
Debasis Jana.
Actually I am not getting your point here.
Please explain me little bit more.
Debasis Jana.
hi there, i just finished my code, and my module is now working, thanks for your all great ideas, sorry if i become lazy along the way. i didn't think what you said..
Thanks again
Gudluck and regrds to all.. :)
smiley22, please use code tags in future when posting code.
[CODE=javascript]
JavaScript code goes here...
[/code]
Sign in to post your reply or Sign up for a free account.
Similar topics
by: David Shorthouse |
last post by:
HI is it posible to auto populate an access database.?
I have 1 table structured
Index_ID. - Index & auto number
First_Name - Char50
Surname - Char50
Initals - Char50
Postcode - Char50...
|
by: C. David Rossen |
last post by:
Hello:
I have a registration form for classes. Each class has a fee. I have a
drop down box whereby the user chooses his class. There is a textbox with
the associated fee. I would like to...
|
by: Jason Galvin |
last post by:
I would like to disable the auto-populating feature (remembers form
element text between post-backs) when creating a .NET form.
I have succeeded in disabling auto-populate by creating my controls...
|
by: Brian Henry |
last post by:
I'm sure some of you ran into this already and wondered how to fix it. When
you Have a solution that contains solution folders (the partially
transparent folders that can hold groupings of...
|
by: Jim |
last post by:
I have a new database in which I have a form where in one field I type
a letter A, B, C or D and the field next to it autofills (auto lookups)
with a description associated with the specific...
|
by: keri |
last post by:
Hi,
I'm still struggling with my tables - frustrating.
If a field in table one is completed I want the following field to auto
populate (dependng on the answer to the first field). I have...
|
by: des-sd |
last post by:
Access Experts, Please help!
I have looked through ref. manuals, Google Groups on "Auto
Populate", and I am still lost.
Problem #1 My DB is 2 relational tables of (1) sales transactions of,...
|
by: zeilak |
last post by:
I am running Windows XP, Access 2002.
I want to know the VB code for the following:
I want to type in the ID # (it's the primary key and is auto-numbering) and then have the access form...
|
by: Ronald |
last post by:
I hope somebody can help. I can't get into the specifics of my
project, but I'll try to create a simple example:
tblVehicle
* VIN (text box)
* Make (text box)
* Model (text box)
frmRepair
|
by: paulyXvpf |
last post by:
Hi All,
FACTS:
> I've created a VB.NET 2005 form, with a SQL Server 2000 backend
> The form has about 30 fields that populate 30 columns in the SQL database
> The form has mostly text feilds,...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |