473,394 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Add rows with mutiple controls on each button click

[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. 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
10 1815
Markus
6,050 Expert 4TB
Is it paramount it is to be done in PHP?

I mean, just using javascript would mean there are no new page requests and, therefore, less resources consumed.

Regards.
Apr 10 '08 #2
Hi markusn,
Thanks for such quick response.If it is possible whole and sole in javascript ,then also it is of much help ,atleast i would be able to get the concept behind it.However if it could be done using php ,it could be better for me.But no problem if its in javascript.

Thanks and Regards
TechnoAtif
Apr 10 '08 #3
TheServant
1,168 Expert 1GB
Yeah, I am thinking you need javascript. Or AJAX would be better. But to expand a bit on markus's post, my apologies if you already know this, just worth making sure we're on the same page!

php is server side, so to regenerate code using php, you would need to request the page again, which usually means refreshing the page. Javascript is client side which means that it can change the code without refreshing (simplified). If your buttons are doing something like changing the layout, or adding/removing something, it'd be more efficient to do it on the client side so it's their resources that are taken up rather than your servers.
Apr 10 '08 #4
Markus
6,050 Expert 4TB
Hi markusn,
Thanks for such quick response.If it is possible whole and sole in javascript ,then also it is of much help ,atleast i would be able to get the concept behind it.However if it could be done using php ,it could be better for me.But no problem if its in javascript.

Thanks and Regards
TechnoAtif
I recommend you do it in javascript - to save resources.

However, i'm not too good with the old JS so maybe you could have an ask in that forum.

For a php solution, what i would do is, have a hidden input on the page and this hidden input contains the number of rows on said page. When the submit is hit this value is passed to a php page. Using this number you construct a for loop to build the rows plus an extra row.

gotta head out to school now!

Catch ya later.
Apr 10 '08 #5
Hi TheServant..

Its Ok if it could be done using javascript or ajax.I am comfortable in javascript and upto a little bit in ajax as well.It wont be much problem for me to get the juice of the solution.So if you have any solution for this.please guide me.

Thanks and Regards
TechnoAtif
Apr 10 '08 #6
Hi markusn00b

its nice to get your explanation on the problem,but i think it needs some more elaborations for me.So please explain a bit more or if you have some sample page already made on such lines,please share it with me.

Thanks and Regards
TechnoAtif
Apr 10 '08 #7
Hi ALL.
Let me tell you the exact conditionso that it may be easier to sort out the problem. Actually i want the same functionality ,i.e. add a new row on each button click .But i want it for the Dojo Control.The controls used belong to Dojo ,the database model used to append the data with the script is mysql and the entire script is to be incorporated in a php page.This is what i require exactly.So making use of any client side scripting would not solve my problem alone.There has to be a server side scripting.I think ajax could be used along with phpmysql to perform the task.If anyoneis able to get my point,so please let me know the possible solution. I hope Dojo wont be any new thing for all of us in this forum.

Thanks and Regards
TechnoAtif
Apr 10 '08 #8
ronverdonk
4,258 Expert 4TB
Until now I only have seen what you want our members to do for you. Maybe it is time for you you tell us what you have done yourself on achieving your goals, in coding, so far. Or do you want our forum mebers to design and write it all?

So show any code you have developed, and I do not mean the few lines in the start post, and we will see what we can do to assist you.

Ronald
Apr 10 '08 #9
TheServant
1,168 Expert 1GB
Hi TheServant..

Its Ok if it could be done using javascript or ajax.I am comfortable in javascript and upto a little bit in ajax as well.It wont be much problem for me to get the juice of the solution.So if you have any solution for this.please guide me.

Thanks and Regards
TechnoAtif
Well if you're good with javascript, how about doing what I suggested? If it is pure javascript you're having a problem with you will have to go to the javascript forum though.
Apr 10 '08 #10
Its ok if you dont want to help me.



Thanks and Regards
TechnoAtif
Apr 11 '08 #11

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

Similar topics

4
by: Bob Lehmann | last post by:
Hi, I pretty sure I've seen this problem addressed before, but I can't find any references. The short story is that I have I have multiple submit buttons on a page, each providing different...
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...
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...
0
by: Flack | last post by:
I have pasted at the end of this message a small sample program I whipped up to do some testing. It's a form with a datagrid and two buttons. Each button clears the dataTable that is the source...
9
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"...
2
by: ravitunk | last post by:
hi..i have a datagridview in my windows application using C#......i want to select mutiple cells(by pressing shift key) or select mutiple columns or multiple rows.....if this happens then i should...
1
by: bgernon | last post by:
I have a table that consists of two rows with three cells each row. The cells contain textboxes. I am able to successfully add a new row with textboxes when a button is clicked. The problem is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.