sarfaraz
Posts: 6
|
| Posted: 03/24/2005, 9:56 PM |
|
I am new to codecharge studio. I have a problem. I wan to generate blank rows for inserting record based on the input. For example . I have two fileds say item name and no of items. This infromation I want to enter first in a form or text box. as
item name number
------------ ---------
item1 2
item2 3
.....
after submiting this I wan five rows to be generated for detail record to be enter for above items as
i
item1 xxx xxx xxx xxx xxx xxx xxxxxxxxxxx
item1 xxx xxx xxx xxx xxx xxx xxxxxxxxxxx
item2 xxxx xxx xxx xxx xxx xxx xxxxxxxxx
item2 xxxx xxx xxx xxx xxx xxx xxxxxxxxx
item2 xxxx xxx xxx xxx xxx xxx xxxxxxxxx
Both can be on one page .. Please guide ..with reference to code charge sutdio using php/mysql
_________________
Sarfaraz |
 |
 |
Damian Hupfeld
|
| Posted: 03/24/2005, 11:26 PM |
|
Im not sure what you mean by number.
If I have two item types, apples and oranges, and I have 2 apples and 3
oranges, why would I need to add different details to each apple and each
orange?
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 03/24/2005, 11:50 PM |
|
Possibly the Order entry example at http://examples.codecharge.com/ExamplePack/OrderEntry/OrderEntry.php would help?
In that example you can create an order and then many detail rows are being created in the editable grid, although they are hidden in that example until you click the "Add Item" button.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
sarfaraz
Posts: 6
|
| Posted: 03/25/2005, 4:48 AM |
|
Thanks , I have seen the example but I need a more simple solution. I want to provide in advance the Total Items . The grild should be created for that many items only and should not allow to add any more rows. Rows must be fixed as per number of items provided.
_________________
Sarfaraz |
 |
 |
Nicole
Posts: 586
|
| Posted: 03/25/2005, 5:33 AM |
|
In this case you can use standard Editable Grid form with Empty Rows property set to a certain value. You can modify this value in run time in Before Show, Before Build/Execute Select events.
_________________
Regards,
Nicole |
 |
 |
sarfaraz
Posts: 6
|
| Posted: 04/05/2005, 1:13 PM |
|
I give my problem in detail so anybody having a solution can give in this forum.
I have two tables . First table has the fields
1. Date
1. product
2. quantity
second table has the fields
1.product
2.description
3.date
4.enteredby
The user will enter the data in first table and on cliking submit button
the second table (editable grid) will populate with the first table details. The rows will be total of quanity filed and the respetive product will get populated automatically for each rows. The remaining details say entered by etc will be filled by the user against each row.
say product is A B C
quanity for A is 1 B is 3 C is 1
on submit total 5 rows ie for A one, for B three and for C one are to be generated as
A ....................................
B--------------------------
B-------------------------
B-------------------------
C------------------------
and on sumbit the records are to be inserted in both the tables as it is.
( three records in first table and 5 records in second table)
I tried from above examples but did not get the desired result. please help
_________________
Sarfaraz |
 |
 |
sarfaraz
Posts: 6
|
| Posted: 04/19/2005, 11:05 AM |
|
I got the problem sovled by writing javascrip function, Now I am able to get the display as desired. The First form has a button . After filling if u click it displays the rows based on above form below. Now I want to insert the record into database . This is case of two tables and I want to insert the record in both tables by one button. For the first table it is single record insert while for the second table it depends on number of rows generated. I if thre are 5 rows then 5 records with the values are to be iserted in the datbase. Wehter it is possible to do this witrh a single button. Please guide me wat custom sql is to be written and where.
_________________
Sarfaraz |
 |
 |