Hey Everyone,
Well i am not sure i have this in the right section. If i don't i am sorry. Just not sure which section to put this question in.
What i am doing is i am using ajax to add multiple fields to my form.Like say the field is serialnum. They can add multiple serialnum to the same form. An the form works great, however, when i submit the form an the information goes into my database is when i run into problems.
In my form a lot of the fields aren't required so people can leave them blank.
So they can add serialnum multiple times an leave one blank, another not blank and such on.
However, for some reason the database will not accept the blanks or show blanks.
So lets say i have entered in
serial num 1: Blank serial num 2: dog
when i go to look at my results it displays it as
serial num 1: dog serial num 2: blank
i have also run into the problem where i am using a cfloop to loop through my results so that instead of putting
every serial i add into one record in my database it will put the information
into multiple records.However, this is what i run into
so lets say i have entered in
serial num 1: Blank serial num 2: dog
when i go to look at my results it displays it as
serial num 1: dog serial num 2: dog
I am basically wondering how can i get my database to except blanks or
maybe even just a default value?
Thank you,
Rachel
CODE
<cfloop index="x" list="#Form.serialnum#" delimiters=",">
<CFQUERY Name="serial" DataSource="CustomerSupport">
exec usp_CS_Insertserial
'#x#','#Form.ID#','#Form.modelno#','#Form.producttype#','#Form.softhardware#',
'#Form.resolution#','#Form.resdate#','#Form.resvertified#','#Form.vertifidate#','#Form.deptvendor#','#Form.hardwarefailure#','
#Form.rma#'
</CFQUERY>
</CFLOOP>