472,988 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,988 software developers and data experts.

Add rows with mutiple controls on each button click using javascript or ajax

[HTML]<form name=frm action="" method="post">
<table>
<tr><td><select name=combo>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<td><input type="text" name=tb1 value=""></td>
<td><input type="text" name=tb2 value=""></td>
<td><input type="text" name=tb3 value=""></td>

</tr>
<input type="submit" name=submit value=AddRow>
</table>
</form>[/HTML]
Hi all .Here is the code for a simple html design .All the controls here are in a single line.
In addition to that ,there is a submit button
Well my real problem starts now.
What iam supposed to do is to write some code such that
each time on clicking of AddRow button a new row with all those controls is generated.
For example,on clicking the button first time ,one such row is generated with a List/Menu Box,and three text boxes.
On next click i have another such row and in all two rows.
On third click i have three such rows and so on.
All this is to be done in php So i posted in the php section of the forum.ut there i get to know that it would be better if i use
javascript or ajax for this.So now i'm posting this problem in this javascript/ajax section.
I have some idea but that is not worthy enough to be implemented.
I am making some increment function in javascript to be called on the onclick eventof the addrow button.
Though its not of much help,so if any one can help me out,You are most welcome.Please go ahead

Thanks and rergards
TechnoAtif
Apr 10 '08 #1
9 1981
acoder
16,027 Expert Mod 8TB
No need for Ajax, just some simple DHTML.

This link provides some explanation, code and demo.
Apr 10 '08 #2
Hi acoder
Thanx for the link.Its indeed very helpful.Next i wanted to know that is there any way out to perform the same task using Dojo Doolkit.I'm sure you must be aware of it.It also uses DHTML. and javascript.

Thanks and Regards
TechnoAtif
Apr 10 '08 #3
vijay
30
use DHTML...........................
Apr 10 '08 #4
acoder
16,027 Expert Mod 8TB
Hi acoder
Thanx for the link.Its indeed very helpful.Next i wanted to know that is there any way out to perform the same task using Dojo Doolkit.
Read the API for dijit.form.
Apr 10 '08 #5
acoder
16,027 Expert Mod 8TB
use DHTML...........................
Did you read the thread and post no. 2?
Apr 10 '08 #6
Hi acoder

So you mean to say that i can use
[PHP]dijit.form.TextBox(params: Object?, srcNodeRef: DomNode|String) [/PHP]
in place of:

[PHP]var el = document.createElement('input');
el.type = 'text';
el.name = 'txtRow' + iteration;
el.id = 'txtRow' + iteration;[/PHP]

Can you please elaborate further

Thanks and Regards
TechnoAtif
Apr 10 '08 #7
acoder
16,027 Expert Mod 8TB
No, that's just the API. I don't use dojo, so I can't be much more help.

If you don't know how to use dojo, I would suggest using the JavaScript code in the link - it's not that difficult.
Apr 10 '08 #8
Unfortunately ,i have no option left lest to use Dojo as its what the client is demanding.So if anyone can help me.please come forward.

Thanks and Regards
TechnoAtif
Apr 11 '08 #9
acoder
16,027 Expert Mod 8TB
You're either going to learn it yourself (a good idea), ask in a Dojo specific forum or wait for someone to turn up and answer.
Apr 11 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dave Elliott | last post by:
After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is after the newly added row without getting bizarre results. I have added the...
0
by: Dave | last post by:
Tried posting in the Winform Forum without much luck, so posting here... After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
3
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
0
by: Sileesh | last post by:
Hi I have html table and a Button in an Aspx page. I am adding one row with some textboxes to Html table each time i click on the Button thru Javascript. Now problem is when when i try to...
22
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
2
by: somaskarthic | last post by:
Hi In my php code , i dynamically created table rows on button click event. Each row contain 3 selectboxes, 7 checkboxes . On each click of these elements i need to submit the form and save the...
2
by: =?Utf-8?B?VG9u?= | last post by:
Hello, I want to understand teh benefits of ajax technology. Does anyone has a good website where AJAX EXTENSIONS is worked out so I really understand it. There a 2 main questions: 1) How about...
10
by: TechnoAtif | last post by:
<form name=frm action="" method="post"> <table> <tr><td><select name=combo> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <td><input type="text"...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.