Forum Moderators: open
If anyone could point me in the right direction it would be appreciated.
I'm fine with the db schema and happy to code this outside of the Ajax world but want to push myself a bit where I can.
The project is a reporting system where the item being reported is made up of a number of static fields, eg.
ItemID, Item Name, Item Ref, Date
In addition to the above, the item can have n number of attribute rows, eg.
AttributeID, Name, Qty, Description
The Ajax part I'm looking for would be to create/update the attributes.
By default, the Item is created with zero attributes and will display the user with a single blank form row to enter an attribute.
On submitting, the attribute is committed to the DB and another blank form row is provided should the user wish to add more attributes.
I've hacked about with an Ajax search autocomplete form in the past with some success so I've got something to start on re. sample code for XML HTTP Request, but just can't get my head around where to begin with this one.
Apologies for the lengthy explanation, hopefully you can get the gist of what I'm aiming to achieve.
onclickcalls the javascript that builds the sendstring for the request and sends it to the ASP script.
If the ASP script replies with 'OK', start building the new form row. It's probably best to do that using DOM methods, such as
createElement()and
appendChild(). Simply adding html to some container's
innerHTMLoften doesn't work, especially with forms.
Let us know if you need more details.