Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank line in form

Status
Not open for further replies.

hungnguyen

Programmer
Sep 22, 2000
43
US
Hi All,

I am using Frontpage as my editor. In the form, I am supposed to display data from SQL server. I have to use FOR loop because there are multiple data. However, when I use FOR loop, there appears a blank line on the top of the form. Is there any way can prevent it??
Thanks
bye
Hung Nguyen
 
Perhaps you could type the code to see what's wrong QUOTE OF THE DAY
"The most important ingredient in the formula of success is knowing how to get along with people"
<%
Jr Clown
%>
 
<%
'Get item details for a place from database
VB function to retrieve data from SQL server
ls_items = session(&quot;doe_job&quot;).getsubjobtype(session &quot;doe_job&quot;).location_id)
%>
'condition when no item
<% if ls_items=&quot;&quot; then
%>
<%else
'Split all items into saperate row
each_item_inf = split(ls_items, &quot;|&quot;, -1, 1)
ll_row=ubound(each_item_inf)-1
%>
<%
dim ar1()
redim ar1(ll_row)

for i=0 to ll_row
'Divide item information into saperate fields
each_field_inf = split(each_item_inf(i),&quot;^&quot;, -1, 1)
'Make checkbox and quantity box names for each table row
chk_name = &quot;item_check&quot; + cstr(i)
qty_name = &quot;quantity&quot; + cstr(i)
cost_name = &quot;cost_name&quot; + cstr(i)
avail_name = &quot;avail&quot; + cstr(i)
unit_name = &quot;unit&quot; + cstr(i)
'Get already ordered items from database
if action = &quot;previous&quot; then
dim ar3
ar3 = session(&quot;ar()&quot;)
else
pass_str = &quot;jobno='&quot; & session(&quot;doe_job&quot;).jobno & &quot;' and item_id =&quot; & each_field_inf(7)
'Another VB function
ordered_item = doe_lookup.getlookup( &quot;job_details&quot;,&quot;item_qty&quot;,&quot;item_id&quot;, pass_str)

oredered_item_id = split(doe_lookup.getDisplaycol , &quot;|&quot;, -1, 1)
ordered_quantity = split(doe_lookup.getDatacol, &quot;|&quot;, -1, 1)
if ordered_item > 0 then
ar1(i)= ordered_quantity(0)
else
ar1(i) = 0
end if
end if
if action = &quot;previous&quot; then
oldq =cstr( ar3(i))
else
if ordered_item > 0 then
oldq = cstr(ordered_quantity(0))
else
oldq = cstr(0)
end if
end if
%>
<input type =hidden name = old_qty value =<%Response.Write(oldq)%> >
<TR>
<INPUT name=<%=chk_name %> type=checkbox tabIndex=40 value=&quot;<% Response.Write(each_field_inf(7))%>&quot;
<% if action = &quot;previous&quot; then
if ar3(i)>0 then %>
checked
end if
else
if ordered_item > 0 then
checked
end if
end if %> >
<%response.write(each_field_inf(0))
response.write(each_field_inf(1))
response.write(each_field_inf(2))
response.write(each_field_inf(3)) %>
<input type = hidden name =<%= cost_name %> value = <%response.write(each_field_inf(3)) %> >
<input type = hidden name=<%= avail_name %> value = <%response.write(each_field_inf(4)) %>>
<input type = hidden name=<%= unit_name %> value = <%response.write(each_field_inf(2)) %>>
<input tabIndex=45 name =<%=qty_name%> type =text size=8
<%if action = &quot;previous&quot; then
if ar3(i)>0 then
Response.Write(&quot;value = &quot; & ar3(i))
end if
else
if ordered_item > 0 then
Response.Write(&quot;value = &quot; & ordered_quantity(0))
end if
end if %>
onblur = &quot;javascript:validate(<%=i%>,<%=qty_name%>,<%=qty_name%>.value,<%= cost_name %>.value,<%= avail_name %>.value,<%= unit_name %>.value,<%= chk_name %>.checked,<%=chk_name%>,<%= ll_row%>,old_qty(<%= i %>).value)&quot;>
<% total_amount = 0
if action = &quot;previous&quot; then
if ar3(i)>0 then
total_amount = cdbl(ar3(i))*cdbl(each_field_inf(3))
end if
else
if ordered_item > 0 then
total_amount = cdbl(ordered_quantity(0))*cdbl(each_field_inf(3))
end if
end if
%>
<SCRIPT>
tot = cal_total(<%= total_amount %>);
if (tot == &quot;0.00&quot;)
{
tot = &quot;&quot;;
}
else
{
tot = &quot;$&quot;+ tot;
}
document.write (&quot;<input readonly name =total type =text size=8 value = &quot;);
document.write (tot);
document.write (&quot;>&quot;);
</SCRIPT>
<%
next
if action = &quot;previous&quot; then
else
session(&quot;ar()&quot;)=ar1
end if
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top