Hi
I have created a dynamic row and inserted the values into the cells of those rows from textboxes. Now I have to edit those values stored in the rows. At the end of each row created dynamically two buttons namely "Edit" and "Delete" are present. If I click the "Edit" button the values in that particular cells should go back to the textboxes for editing and then after editing it should go to the corresponding place.
Can any one help to solve this using Javascript.
Thanks in Advance.........
17 5512
Hi
I have created the table using an email id. The end of each row contains "Edit" and "Delete" options. If I click Edit Button of that particular row, The emailid should be transferred to other page for editing and then return back after modification to the previous page.
Thanks.
It would be so helpful for me.
Hi
I have created the table using an email id. The end of each row contains "Edit" and "Delete" options. If I click Edit Button of that particular row, The emailid should be transferred to other page for editing and then return back after modification to the previous page.
Thanks.
It would be so helpful for me.
1.) Are you using JSP?
2.) Do you have each edit link in its own form? You can pass the email value as a hidden field of that form.
thanks for ur reply
I am creating a row dynamically in that email address, edit and delete buttons are there. For each row created dynamically the corresponding edit and delete buttons are also created.
If i click an edit button in a particular row the emailid in tht row should be extracted for modification.
thanks for ur reply
I am creating a row dynamically in that email address, edit and delete buttons are there. For each row created dynamically the corresponding edit and delete buttons are also created.
If i click an edit button in a particular row the emailid in tht row should be extracted for modification.
You'll still need to tell us if you're using JSP or just Javascript.
How does the submiting work by clicking the edit button? You need a form to submit. Once you answer my initial questions, everything will become clear from then on.
You'll still need to tell us if you're using JSP or just Javascript.
How does the submiting work by clicking the edit button? You need a form to submit. Once you answer my initial questions, everything will become clear from then on.
It was in Javascript. "Edit" is not a submit button. It is generated dynamically when each new EmaiiId is added. Now when "Edit" is clicked the email ID should be brought for editing.
For each mailID added there is a corresponding "Edit" and "Delete" is present.
If any Edit or Delete of a particular row is clicked then the that row should be brought for modification. After modification the mailID should be send back to the same place.
It was in Javascript. "Edit" is not a submit button. It is generated dynamically when each new EmaiiId is added. Now when "Edit" is clicked the email ID should be brought for editing.
For each mailID added there is a corresponding "Edit" and "Delete" is present.
If any Edit or Delete of a particular row is clicked then the that row should be brought for modification. After modification the mailID should be send back to the same place.
Then the question belongs in the Javascript forum and so I'll move it there.
Hi
here is my code.
<html>
<body>
<script>
function addRow()
{
var newRow = document.all("tblGrid").insertRow();
var oCell = newRow.insertCell();
oCell.innerHTML = f1.fullname.value;
oCell = newRow.insertCell();
oCell.innerHTML = f1.emailaddress.value;
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='button' value='Edit' onclick='editvalidate(this);'/> <input type='button' value='Delete' onclick='removeRow(this);'/>";
}
function removeRow(src)
{
var oRow = src.parentElement.parentElement;
document.all("tblGrid").deleteRow(oRow.rowIndex);
}
</script>
<table id="tblGrid">
<tr><td></td></tr>
</table>
<form name="f1">
Fullname<input type="text" name="fullname"><br>
EmailAddress<input type="text" name="emailaddress"><br>
<input type="button" value="add" onclick="addRow();">
</form>
</body>
</html>
This coding works fine for deleting a particular row. But when i click the "Edit" button of the row created, I need those two values such as "name" and "emailaddress" to be brought back to the textbox and edited and then send back..
It would be so useful if anyone help me.
Thanks
by
sudha
this is needed urgently can anyone help pls.........
help needed urgently........
I have a table contains the email Id and edit and delete options.and i hava a create new button.If iclick the createnew button it goes to the jsp page it contains email Id text field.if we enter the email id and submit on that page control goes to the same page and i want to see the email id dynamically in that table the edit and delete options also created dynamically.if i click the edit option it goes to the entire email id page and i change the password information it will change the password and submit means it returns the same page.
if i click the delete option div should displayed,in that two options one is yes and another is no ,if i click yes that entire row will be deleted, if click no just div only deleted and then entire row will be delete while checked some checkbox
can u help me ...
thanks in advance.....
help needed urgently........
There are several ways of doing this.
One way is to write the email in a hidden input for each row.
Post what code you have so far so we can work with that.
These seem to be on the same topic, so I've merged the threads.
I've merged about 4 or 5 threads. Please keep all posts in one thread. It's very difficult if the posts are all in separate threads and you have 2/3 answers in different places.
Hi
here is my code.
<html>
<body>
<script>
function addRow()
{
var newRow = document.all("tblGrid").insertRow();
var oCell = newRow.insertCell();
oCell.innerHTML = f1.fullname.value;
oCell = newRow.insertCell();
oCell.innerHTML = f1.emailaddress.value;
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='button' value='Edit' onclick='editvalidate(this);'/> <input type='button' value='Delete' onclick='removeRow(this);'/>";
}
function removeRow(src)
{
var oRow = src.parentElement.parentElement;
document.all("tblGrid").deleteRow(oRow.rowIndex);
}
</script>
<table id="tblGrid">
<tr><td></td></tr>
</table>
<form name="f1">
Fullname<input type="text" name="fullname"><br>
EmailAddress<input type="text" name="emailaddress"><br>
<input type="button" value="add" onclick="addRow();">
</form>
</body>
</html>
This coding works fine for deleting a particular row. But when i click the "Edit" button of the row created, I need those two values such as "name" and "emailaddress" to be brought back to the textbox and edited and then send back..
It would be so useful if anyone help me.
Thanks
by
sudha
OK, now we have some code. Firstly, this is IE-only code. document.all should be document.getElementById.
Create a function, editvalidate which gets the current row and from that the first and second cells. cells[0] and cells[1] will refer to those cells. You can refer to the text boxes by e.g. - document.forms.f1.fullname.value=...
See how this example does it.
Thanks a lot.
The example you have given is very much useful.
I had worked out tht format using the following codings. I just share my codings here.
the codings for editing
function editvalidate(src)
{
var currObj = src;
while( (currObj.tagName != "TR") && (currObj.tagName != null) ){
currObj = currObj.parentElement;
}
var rowObj = currObj;
var cellCount = rowObj.cells.length;
var tdObj = rowObj.firstChild;
var colValues = new Array( cellCount );
for( i = 0; i < cellCount; i++ ) {
currObj = rowObj.cells[i];
while( (currObj != null) && (currObj.innerText == null) ) {
currObj = currObj.firstChild;
}
if( currObj != null )
colValues[i] = currObj.innerText;
}
var storename=colValues[0];
// var namelength=parseInt(strlen(storename));
var n=storename.length;
var removename=storename.substring(1,n-1);
document.f1.fullname.value=removename;
var storeemail=colValues[1];
var n1=storeemail.length;
var removeemail=storeemail.substring(1,storeemail.leng th-1);
document.f1.emailaddress.value=removeemail;
var oRow = src.parentElement.parentElement;
document.all("tblGrid").deleteRow(oRow.rowIndex);
}
Thanks a lot.
The example you have given is very much useful.
I had worked out tht format using the following codings. I just share my codings here.
You're welcome. Glad you got it working fine.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: steveneng |
last post by:
C++ Primer Plus Programming Exercises 4th Ed - Prate
Help I'm trying to refresh myself and I'm stuck on this problem (not
homework/school related but for personal advancement).
6: Do...
|
by: Jen |
last post by:
Hi
I have created some controls (HtmlInputText, HtmlGenericControl, TextBox) dynamically. But I have problem getting the values from these controls to save them. Is there a way to do that?
...
|
by: Mark Broadbent |
last post by:
This one has got me absolutely stumped.
At work I have created a simple web form that gets data from a sql backend
and puts this to a dataset.
I have an edit button that when clicked will set...
|
by: Larry Grady |
last post by:
Anyone up for a challenge?
I've been struggling with this for a few days and was hoping someone could
help me. Pouring through all the messageboards I just can't find the
solution.
We have a...
|
by: \A_Michigan_User\ |
last post by:
I'm using asp.net/vb.net/ado.net to create a very simple user interface.
(Everything works if I use STATICALLY created textBoxes... but not when I
make them DYNAMICALLY.)
1. Execute a SQL...
|
by: Robert McEuen |
last post by:
Sorry if this double-posts...Google doesn't do a very good job of
communicating whether something has posted or not.
Using Access 97, WindowsXP
Is there a way to pass command line parameters...
|
by: Preben Randhol |
last post by:
Hi
A short newbie question. I would like to extract some values from a
given text file directly into python variables. Can this be done simply
by either standard library or other libraries? Some...
|
by: somaskarthic |
last post by:
Hi
How to get the values of dynamically created checkboxes which are checked and unchecked (for both the conditions). Only the selected checkbox values are posted as 'On' . How can i get the value...
|
by: assgar |
last post by:
Hi
Developemnt on win2003 server. Final server will be linux
Apache,Mysql and PHP is being used.
I use 2 scripts(form and process).
The form displays multiple dynamic rows with chechboxs,...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |