chuck wrote:[color=blue]
> Hello,
> I have to create a complex form to handle company product returns.
> Right now, I have some form fields to describe the product being returned,
> productID, productDES,ProductQTY.
> Thats fine. I have a button that will dynamically create those
> fields with javascript, with an 'add more' button. It creates a line
> with consecutive names like
> productID[1], productDES[1]...productID[2]...productID[3]...
> similar to this
>
http://chucklarge.mine.nu/test/javas...element-02.htm
>
> Ok, so the problem i have is for each one of those lines of products to
> return, serial
> numbers need to be entered that match the Quantity being returned. There
> can
> be hundreds or more of each different product to return.[/color]
You have many serial numbers for each product?
[color=blue]
> The client mentioned having a popup window that would allow you to enter
> each of
> the serial numbers and have those linked to the form line of the main page.
> This sounds fine with me, as long as they don't complain later about
> popup blockers,[/color]
Popup blockers usually only block unrequested pop-ups, but not all. You
can create an HTML element that mimics a popup (say use a div) and then
put the serial numbers into an option list or text list with onclick
attributes.
[color=blue]
>
> anyway, unless there is a better way to handle this, I will create a
> popup that has
> one line of fields, the serial number is entered, and the condition and
> then you
> hit and add button and it populates the info below, then you keep
> entering the
> other serial numbers.[/color]
You could put the serial numbers into script files as an array or object
and load the associated file only if the product is selected. They need
only be loaded once each (or just load them anyway...).
The defer attribute can be used so that the page keeps loading other
content while the serial number script files are loaded (in theory anyway).
[color=blue]
>
> I guess then I want to know how to get the info back to the main page. I
> will
> store all the serial numbers in an array, so hopefully that will make it
> easier,
> but then where does that info get stored on the main page, and can it all
> be submitted when the main form is submitted?[/color]
When the serial number is selected, write it to a field in the form and
it will be submitted with the form. You may want to make the field
readonly so the user doesn't mess with it, or write the number to a
hidden field and display the number as text.
It may seem simple, but you need quite a bit of logic to handle the
interface, it's very easy to end up with non-matching products and
serial numbers.
--
Rob