473,580 Members | 2,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textarea outside of loop

Jen
Hi. I have this problem that I think should be easy but have been struggling
with this for days.
I have a list based on a recordset from a database. This list consists of
records meeting a certain criteria and at the bottom of this list i have a
button that inserts all these records to a´nother table in the database. So
long everything's ok.
BUT, at the top of this list I have a textarea that the user can write down
some text to be put into every record in the table also. I can't loop this
textarea, then I would have to fill out them all anyway.
I think that some variable witch fetched the text from an onload popup
window by request.form or javascript prompt would do the trick but I'm not
sure if it's possible or even how to do this. -And, I would like to have the
textarea at the top of the page instead of some silly popup thing.

How could I achieve this?
Dec 19 '06 #1
16 2786
need to see your code
"Jen" <je*@hoganmail. comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
Hi. I have this problem that I think should be easy but have been
struggling with this for days.
I have a list based on a recordset from a database. This list consists of
records meeting a certain criteria and at the bottom of this list i have a
button that inserts all these records to a´nother table in the database.
So long everything's ok.
BUT, at the top of this list I have a textarea that the user can write
down some text to be put into every record in the table also. I can't loop
this textarea, then I would have to fill out them all anyway.
I think that some variable witch fetched the text from an onload popup
window by request.form or javascript prompt would do the trick but I'm not
sure if it's possible or even how to do this. -And, I would like to have
the textarea at the top of the page instead of some silly popup thing.

How could I achieve this?


Dec 19 '06 #2
Jen wrote:
Hi. I have this problem that I think should be easy but have been
struggling with this for days.
I have a list based on a recordset from a database. This list
consists of records meeting a certain criteria and at the bottom of
this list i have a button that inserts all these records to a´nother
table in the database. So long everything's ok.
BUT, at the top of this list I have a textarea that the user can
write down some text to be put into every record in the table also. I
can't loop this textarea, then I would have to fill out them all
anyway. I think that some variable witch fetched the text from an onload
popup
window by request.form or javascript prompt would do the trick but
I'm not sure if it's possible or even how to do this. -And, I would
like to have the textarea at the top of the page instead of some
silly popup thing.
How could I achieve this?
This sounds "wrong-headed" for two reasons:

1. You are storing data (rows) in two separate places in the database.
Unless this is some sort of archiving scheme, this practice will typically
lead to maintenance nightmares.
2. You are storing the same data into multiple rows in a table. I cannot
fathom a possible reason for doing this. Could you explain please?

Having said that, I don't understand the problem you are having. "Looping"
through a textarea should not have even entered your mind if I am
understanding your requirements correctly: simply assign the text in the
textarea to a variable and use that variable in your insert statements. Why
would you even be thinking about a popup window?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Dec 19 '06 #3

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:uD******** ********@TK2MSF TNGP03.phx.gbl. ..
Jen wrote:
>Hi. I have this problem that I think should be easy but have been
struggling with this for days.
I have a list based on a recordset from a database. This list
consists of records meeting a certain criteria and at the bottom of
this list i have a button that inserts all these records to a´nother
table in the database. So long everything's ok.
BUT, at the top of this list I have a textarea that the user can
write down some text to be put into every record in the table also. I
can't loop this textarea, then I would have to fill out them all
anyway. I think that some variable witch fetched the text from an onload
popup
window by request.form or javascript prompt would do the trick but
I'm not sure if it's possible or even how to do this. -And, I would
like to have the textarea at the top of the page instead of some
silly popup thing.
How could I achieve this?

This sounds "wrong-headed" for two reasons:

1. You are storing data (rows) in two separate places in the database.
Unless this is some sort of archiving scheme, this practice will typically
lead to maintenance nightmares.
2. You are storing the same data into multiple rows in a table. I cannot
fathom a possible reason for doing this. Could you explain please?

Having said that, I don't understand the problem you are having. "Looping"
through a textarea should not have even entered your mind if I am
understanding your requirements correctly: simply assign the text in the
textarea to a variable and use that variable in your insert statements.
Why would you even be thinking about a popup window?


my thoughts also,

Need to see code

>
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Dec 19 '06 #4
Jen
1. You are storing data (rows) in two separate places in the database.
Unless this is some sort of archiving scheme, this practice will typically
lead to maintenance nightmares.
2. You are storing the same data into multiple rows in a table. I cannot
fathom a possible reason for doing this. Could you explain please?

Having said that, I don't understand the problem you are having. "Looping"
through a textarea should not have even entered your mind if I am
understanding your requirements correctly: simply assign the text in the
textarea to a variable and use that variable in your insert statements.
Why would you even be thinking about a popup window?

1. This won't lead to any maintenance nightmares(well , one can hope, I'm
not that good at this as you can see ;), these tables are linked in a
relationship.
2. I am not storing any same data into multiple rows in a table. Basically,
this is a simple monthly billing app. I have one table holding the tenant's
data (name and addresses, monthly rent's & other monthly payments, unique
text to print on the bill for the actual tenant etc. etc.), one (linked)
table holding the landlord's 80-90 apartemnt's and one (unlinked) table with
the landlord's data (bank-accounts etc.)
Then I have this linked table consisting of the bills.
The landlord wants to open (log on to) this app once a month online and
simply write something that is unique for the actual month (the name of the
year & month, some christmas greetings.. for example, and here's the
textarea causing me the headache), klick on print at the bottom of the list
and every bill is printed out at the same time as these are written into the
bills table. And presto, the landlord is done for the month with wery little
effort. The bills are later wiewable all by month or by apartment or by
tenant in a timeframe that is choosen.
How would I assign a textarea to a variable on the same page? I'm reading
this can't be done (http://www.dmxzone.com/forum/topic.asp?topic_id=15746),
thus my thoughts on some popup solution.

Please bear with me, I'm new at this stuff, and on top of that my english
isn't that good my mothertung being swedish
:[

Jen.
>
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Dec 19 '06 #5

"Jen" <je*@hoganmail. comwrote in message
news:OX******** ********@TK2MSF TNGP03.phx.gbl. ..
>1. You are storing data (rows) in two separate places in the database.
Unless this is some sort of archiving scheme, this practice will
typically lead to maintenance nightmares.
2. You are storing the same data into multiple rows in a table. I cannot
fathom a possible reason for doing this. Could you explain please?

Having said that, I don't understand the problem you are having.
"Looping" through a textarea should not have even entered your mind if I
am understanding your requirements correctly: simply assign the text in
the textarea to a variable and use that variable in your insert
statements. Why would you even be thinking about a popup window?

1. This won't lead to any maintenance nightmares(well , one can hope, I'm
not that good at this as you can see ;), these tables are linked in a
relationship .

2. I am not storing any same data into multiple rows in a table.
Basically, this is a simple monthly billing app. I have one table holding
the tenant's data (name and addresses, monthly rent's & other monthly
payments, unique text to print on the bill for the actual tenant etc.
etc.), one (linked) table holding the landlord's 80-90 apartemnt's and one
(unlinked) table with the landlord's data (bank-accounts etc.)
Then I have this linked table consisting of the bills.
The landlord wants to open (log on to) this app once a month online and
simply write something that is unique for the actual month (the name of
the year & month, some christmas greetings.. for example, and here's the
textarea causing me the headache), klick on print at the bottom of the
list and every bill is printed out at the same time as these are written
into the bills table. And presto, the landlord is done for the month with
wery little effort. The bills are later wiewable all by month or by
apartment or by tenant in a timeframe that is choosen.
How would I assign a textarea to a variable on the same page? I'm reading
this can't be done
(http://www.dmxzone.com/forum/topic.asp?topic_id=15746), thus my thoughts
on some popup solution.

why cant it be done.

This seems like a simple job

We need to see your code
>
Please bear with me, I'm new at this stuff, and on top of that my english
isn't that good my mothertung being swedish
:[

Jen.
>>
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Dec 19 '06 #6
Jen wrote:
>1. You are storing data (rows) in two separate places in the
database. Unless this is some sort of archiving scheme, this
practice will typically lead to maintenance nightmares.
2. You are storing the same data into multiple rows in a table. I
cannot fathom a possible reason for doing this. Could you explain
please?

Having said that, I don't understand the problem you are having.
"Looping" through a textarea should not have even entered your mind
if I am understanding your requirements correctly: simply assign the
text in the textarea to a variable and use that variable in your
insert statements. Why would you even be thinking about a popup
window?

1. This won't lead to any maintenance nightmares(well , one can hope,
I'm not that good at this as you can see ;), these tables are linked
in a relationship.

2. I am not storing any same data into multiple rows in a table.

That's how I interpreted this:
" ... some text to be put into every record in the table also."
Basically, this is a simple monthly billing app. I have one table
holding the tenant's data (name and addresses, monthly rent's & other
monthly payments, unique text to print on the bill for the actual
tenant etc. etc.), one (linked) table holding the landlord's 80-90
apartemnt's and one (unlinked) table with the landlord's data
(bank-accounts etc.)
Then I have this linked table consisting of the bills.
The landlord wants to open (log on to) this app once a month online
and simply write something that is unique for the actual month (the
name of the year & month, some christmas greetings.. for example, and
here's the textarea causing me the headache), klick on print at the
bottom of the list and every bill is printed out at the same time as
these are written into the bills table. And presto, the landlord is
done for the month with wery little effort. The bills are later
wiewable all by month or by apartment or by tenant in a timeframe
that is choosen.
So you should create a table to contain the monthly message: one record
per month. use a join to link the monthly message to the bills paid for
that month
How would I assign a textarea to a variable on the same page? I'm
reading this can't be done
(http://www.dmxzone.com/forum/topic.asp?topic_id=15746),
What do you mean? There are two examples of doing it on that page. I
suspect Brian was not expressing himself very well.
thus my
thoughts on some popup solution.
I still don't understand why that would be relevant.
>
Please bear with me, I'm new at this stuff, and on top of that my
english isn't that good my mothertung being swedish
Your english is better than my swedish :-)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 19 '06 #7
Jen
So you should create a table to contain the monthly message: one record
per month. use a join to link the monthly message to the bills paid for
that month
>How would I assign a textarea to a variable on the same page? I'm
reading this can't be done
(http://www.dmxzone.com/forum/topic.asp?topic_id=15746),

What do you mean? There are two examples of doing it on that page. I
suspect Brian was not expressing himself very well.
>thus my
thoughts on some popup solution.

I still don't understand why that would be relevant.
>>
Please bear with me, I'm new at this stuff, and on top of that my
english isn't that good my mothertung being swedish

Your english is better than my swedish :-)
--
If a textarea is on the same page that the sql insert code, how would one
get the text from the textarea into a variable without "refreshing " the
page? It is static on the screen while writing in text in the textbox, it
wont get into a variable by simple writin the text(?) Or would one use some
kind og afterupdate "behaviour" on the textarea for putting the text into a
variable on the page and thus getting the text into each record? This is why
I talked about some popup window where I could get the text from a textarea
in this popup window into an variable with request.form.
Anyways, here's the code (form) if that can help you guys help me. I really
do appretiate you taking the time to try to help out us beginners.

<form ACTION="<%=MM_e ditAction%>" METHOD="POST" name="form_fakt urera"
class="ewTable" id="form_faktur era">
<br />
Skriv in text som syns p&aring; varje faktura denna m&aring;nad:
<br />
<input name="faktura_i d" type="hidden" id="faktura_id " value="">
<% ins_rs_fakturer a = ins_rs_fakturer a+1 %>
<textarea name="txt_egen_ fakturatext" cols="60" rows="2"></textarea>
<table width="98%" border="0" cellspacing="0" class="ewTable" >
<tr class="ewTableH eader">
<th scope="col"><di v align="left">Na mn</div></th>
<th scope="col"><di v align="left">Hy resbostad</div></th>
<th scope="col"><di v align="left">N& auml;radress</div></th>
<th scope="col"><di v align="left">Te lefon</div></th>
<th scope="col"><di v align="left">Fa kturatext</div></th>
<th scope="col"><di v align="left">M& aring;nadshyra</div></th>
<th scope="col"><di v align="left">Mo ms</div></th>
</tr>
<%
While ((Repeat1__numR ows <0) AND (NOT rs_fakturera.EO F))
%>
<tr >
<td>
<%=(rs_fakturer a.Fields.Item(" Efternamn").Val ue)%>&nbsp;<%=( rs_fakturera.Fi elds.Item("Forn amn").Value)%>
<input name="hiddenFie ld_daum<%=ins_r s_fakturera%>"
type="hidden" id="hiddenField _daum" value="<%=date( )%>">
<input name="hiddenFie ld_manad_ar<%=i ns_rs_fakturera %>"
type="hidden" id="hiddenField _manad_ar" value="<%=month (now) & "_" &
year(now)%>">
<input name="hiddenFie ld_efternamn<%= ins_rs_fakturer a%>"
type="hidden" id="hiddenField _efternamn"
value="<%=(rs_f akturera.Fields .Item("Efternam n").Value)%> ">
<input name="hiddenFie ld_fornamn<%=in s_rs_fakturera% >"
type="hidden" id="hiddenField _fornamn"
value="<%=(rs_f akturera.Fields .Item("Fornamn" ).Value)%>">
<input name="hiddenFie ld_kund_id<%=in s_rs_fakturera% >"
type="hidden" id="hiddenField _kund_id"
value="<%=(rs_f akturera.Fields .Item("Id").Val ue)%>"></td>
<td><%=(rs_fakt urera.Fields.It em("Namn").Valu e)%>
<input name="hiddenFie ld_hyresbostad< %=ins_rs_faktur era%>"
type="hidden" id="hiddenField _hyresbostad"
value="<%=(rs_f akturera.Fields .Item("Hyresbos tad").Value)%>" >
<input name="hiddenFie ld_bostadsnamn< %=ins_rs_faktur era%>"
type="hidden" id="hiddenField _bostadsnamn"
value="<%=(rs_f akturera.Fields .Item("Namn").V alue)%>"></td>
<td><%=(rs_fakt urera.Fields.It em("Naradress") .Value)%>
<input name="hiddenFie ld_naradress<%= ins_rs_fakturer a%>"
type="hidden" id="hiddenField _naradress"
value="<%=(rs_f akturera.Fields .Item("Naradres s").Value)%> "></td>
<td><%if (rs_fakturera.F ields.Item("tel efon").Value) <"" then%>
<%=(rs_fakturer a.Fields.Item(" telefon").Value )%>&nbsp;
<%if (rs_fakturera.F ields.Item("mob iltelefon").Val ue) <""
then%>
<%=(rs_fakturer a.Fields.Item(" mobiltelefon"). Value)%>
<%end if
end if
%>
<input name="hiddenFie ld_telefon<%=in s_rs_fakturera% >"
type="hidden" id="hiddenField _telefon" value="<%if
(rs_fakturera.F ields.Item("tel efon").Value) <"" then%>
<%=(rs_fakturer a.Fields.Item(" telefon").Value )%>&nbsp;
<%if (rs_fakturera.F ields.Item("mob iltelefon").Val ue) <"" then%>
<%=(rs_fakturer a.Fields.Item(" mobiltelefon"). Value)%>
<%end if
end if
%>"></td>
<td><%=(rs_fakt urera.Fields.It em("text_pa_fak tura").Value)%>
<input name="hiddenFie ld_fakturatext< %=ins_rs_faktur era%>"
type="hidden" id="hiddenField _fakturatext"
value="<%=(rs_f akturera.Fields .Item("text_pa_ faktura").Value )%>"></td>
<td><%=(rs_fakt urera.Fields.It em("Manadshyra" ).Value)&":-"%>
<input name="hiddenFie ld_manadshyra<% =ins_rs_fakture ra%>"
type="hidden" id="hiddenField _manadshyra"
value="<%=(rs_f akturera.Fields .Item("Manadshy ra").Value)%> ">
<input name="hiddenFie ld_finsk<%=ins_ rs_fakturera%>"
type="hidden" value="<%if (rs_fakturera.F ields.Item("Fin sk").Value) = True
then response.Write(-1) else response.Write( "0")%>">
<input name="hiddenFie ld_postnr<%=ins _rs_fakturera%> "
type="hidden" id="hiddenField _postnr"
value="<%=(rs_f akturera.Fields .Item("postnr") .Value)%>">
<input name="hiddenFie ld_postadress<% =ins_rs_fakture ra%>"
type="hidden" id="hiddenField _postadress"
value="<%=(rs_f akturera.Fields .Item("postadre ss").Value)%> ">
<input name="hiddenFie ld_betalningsti d<%=ins_rs_fakt urera%>"
type="hidden" id="hiddenField _betalningstid"
value="<%=(rs_f akturera.Fields .Item("Betalnin gstid_dagar").V alue)%>"></td>
<td><center>
<input name="hiddenFie ld_moms<%=ins_r s_fakturera%>"
type="hidden" value="<%if (rs_fakturera.F ields.Item("mom s").Value) = True
then response.Write(-1) else response.Write( "0")%>">
<%if (rs_fakturera.F ields.Item("mom s").Value) = True then
response.Write( "Ja") ELSE response.Write( "Nej")%>
<input name="hiddenFie ld_betald<%=ins _rs_fakturera%> "
type="hidden" id="hiddenField _betald" value="">
</center></td>
</tr>
<%
Repeat1__index= Repeat1__index+ 1
Repeat1__numRow s=Repeat1__numR ows-1
rs_fakturera.Mo veNext()
Wend
%>
</table>
<br>
<table width="98%" border="0" cellspacing="0" class="ewListAd d">
<tr>
<td><div align="right">
<input type="submit" name="Submit" value=" Fakturera
&raquo;&raquo;" >
</div></td>
</tr>
</table>
</form>
Dec 19 '06 #8
Jen wrote:
If a textarea is on the same page that the sql insert code,
I don't see any sql insert code in your extract. All I see is the code
for displaying the data. I searched for "Insert", "AddNew" and "Update".
Are you sure the insert isn't happening on the page to which you submit
this form?
how would
one get the text from the textarea into a variable without
"refreshing " the page? It is static on the screen while writing in
text in the textbox, it wont get into a variable by simple writin the
text(?) Or would one use some kind og afterupdate "behaviour" on the
textarea for putting the text into a variable on the page and thus
getting the text into each record?
Now we are getting into client-side code which is out of scope for this
group: ASP is server-side code. When you start talking about
afterupdate, or any other event that takes place on the client, then you
are no longer in the ASP "world". Further questions about this should go
to a client-side scripting group such as
microsoft.publi c.scripting.jsc ript.

Here is a simple example of what you seem to want (note: you can save
this in a .htm page and it will work, which reinforces the point that
this is no longer about asp):

<html>
<head>
<script type="text/javascript">
var EnteredText
function handleChange(ob j)
{
EnteredText=obj .value;
alert(EnteredTe xt);
}
</script>
</head>
<body>
<textarea name="txt_egen_ fakturatext" cols="60" rows="2"
onchange="handl eChange(this);" >
</textarea>
</body>
</html>

Run the page, type in some text and press tab.
<snip>

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 19 '06 #9
Jen
I don't see any sql insert code in your extract. All I see is the code
for displaying the data. I searched for "Insert", "AddNew" and "Update".
Are you sure the insert isn't happening on the page to which you submit
this form?
>how would
one get the text from the textarea into a variable without
"refreshing " the page? It is static on the screen while writing in
text in the textbox, it wont get into a variable by simple writin the
text(?) Or would one use some kind og afterupdate "behaviour" on the
textarea for putting the text into a variable on the page and thus
getting the text into each record?

Now we are getting into client-side code which is out of scope for this
group: ASP is server-side code. When you start talking about
afterupdate, or any other event that takes place on the client, then you
are no longer in the ASP "world". Further questions about this should go
to a client-side scripting group such as
microsoft.publi c.scripting.jsc ript.

Here is a simple example of what you seem to want (note: you can save
this in a .htm page and it will work, which reinforces the point that
this is no longer about asp):

<html>
<head>
<script type="text/javascript">
var EnteredText
function handleChange(ob j)
{
EnteredText=obj .value;
alert(EnteredTe xt);
}
</script>
</head>
<body>
<textarea name="txt_egen_ fakturatext" cols="60" rows="2"
onchange="handl eChange(this);" >
</textarea>
</body>
</html>

Run the page, type in some text and press tab.
<snip>

I'm not going for some client side scripts, I was just thinking out loud how
it could be possible inserting the text from a textarea into a variable,
textarea being on the same page as the variable. I probably understood you
wrong as I thought you made it clear that there couldn't be any problem
getting the text from a textarea into a variable from one and same page,
despite the posts in the dmxzone njewsgroup.
I don't think your javascript example would work anyway in this case.
Nothing serverside (variable) is refreshed.
Here's the code including the insert code, sorry, I left it out by mistake.
And here's a screendump of the page with the list and the textarea (the
values going into the table are in hiddenfields
http://www.comtech.fi/filer/example.gif)

Jen.

<%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnecti on
Dim MM_editTable
Dim MM_editRedirect Url
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.Se rverVariables(" SCRIPT_NAME"))
If (Request.QueryS tring <"") Then
MM_editAction = MM_editAction & "?" &
Server.HTMLEnco de(Request.Quer yString)
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
Dim rs_fakturera
Dim rs_fakturera_nu mRows

Set rs_fakturera = Server.CreateOb ject("ADODB.Rec ordset")
rs_fakturera.Ac tiveConnection = MM_conn_heinone n_STRING
rs_fakturera.So urce = "SELECT hyresgast.*, bostad.* FROM bostad INNER JOIN
hyresgast ON bostad.bostads_ id = hyresgast.Hyres bostad WHERE
skall_fakturera s = true ORDER BY Efternamn"
rs_fakturera.Cu rsorType = 2
rs_fakturera.Cu rsorLocation = 2
rs_fakturera.Lo ckType = 1
rs_fakturera.Op en()

rs_fakturera_nu mRows = 0
%>
<%
Dim Repeat1__numRow s
Dim Repeat1__index

Repeat1__numRow s = -1
Repeat1__index = 0
rs_fakturera_nu mRows = rs_fakturera_nu mRows + Repeat1__numRow s
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats
variables

Dim rs_fakturera_to tal
Dim rs_fakturera_fi rst
Dim rs_fakturera_la st

' set the record count
rs_fakturera_to tal = rs_fakturera.Re cordCount

' set the number of rows displayed on this page
If (rs_fakturera_n umRows < 0) Then
rs_fakturera_nu mRows = rs_fakturera_to tal
Elseif (rs_fakturera_n umRows = 0) Then
rs_fakturera_nu mRows = 1
End If

' set the first and last displayed record
rs_fakturera_fi rst = 1
rs_fakturera_la st = rs_fakturera_fi rst + rs_fakturera_nu mRows - 1

' if we have the correct record count, check the other stats
If (rs_fakturera_t otal <-1) Then
If (rs_fakturera_f irst rs_fakturera_to tal) Then
rs_fakturera_fi rst = rs_fakturera_to tal
End If
If (rs_fakturera_l ast rs_fakturera_to tal) Then
rs_fakturera_la st = rs_fakturera_to tal
End If
If (rs_fakturera_n umRows rs_fakturera_to tal) Then
rs_fakturera_nu mRows = rs_fakturera_to tal
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count
them

If (rs_fakturera_t otal = -1) Then

' count the total records by iterating through the recordset
rs_fakturera_to tal=0
While (Not rs_fakturera.EO F)
rs_fakturera_to tal = rs_fakturera_to tal + 1
rs_fakturera.Mo veNext
Wend

' reset the cursor to the beginning
If (rs_fakturera.C ursorType 0) Then
rs_fakturera.Mo veFirst
Else
rs_fakturera.Re query
End If

' set the number of rows displayed on this page
If (rs_fakturera_n umRows < 0 Or rs_fakturera_nu mRows rs_fakturera_to tal)
Then
rs_fakturera_nu mRows = rs_fakturera_to tal
End If

' set the first and last displayed record
rs_fakturera_fi rst = 1
rs_fakturera_la st = rs_fakturera_fi rst + rs_fakturera_nu mRows - 1

If (rs_fakturera_f irst rs_fakturera_to tal) Then
rs_fakturera_fi rst = rs_fakturera_to tal
End If
If (rs_fakturera_l ast rs_fakturera_to tal) Then
rs_fakturera_la st = rs_fakturera_to tal
End If

End If
%>
<%
' *** FX Insert Multiple Records SP in form_fakturera
If (rs_fakturera_f irst <"") Then ins_rs_fakturer a = rs_fakturera_fi rst-1
Else ins_rs_fakturer a = 0 End If ' counter
If (cStr(Request.F orm("Submit")) <"") Then
FX_sqlerror = ""
FX_insredir = "fakturalist.as p"
FX_fields =
Array("txt_egen _fakturatext"," hiddenField_dau m","hiddenField _manad_ar","hid denField_eftern amn","hiddenFie ld_fornamn","hi ddenField_kund_ id","hiddenFiel d_hyresbostad", "hiddenField_bo stadsnamn","hid denField_naradr ess","hiddenFie ld_telefon","hi ddenField_faktu ratext","hidden Field_manadshyr a","hiddenField _finsk","hidden Field_postnr"," hiddenField_pos tadress","hidde nField_betalnin gstid","hiddenF ield_moms","hid denField_betald ")
FX_altv = false
tmp = "ADODB.Comm and"
Set insert_Multi = Server.CreateOb ject(tmp)
insert_Multi.Ac tiveConnection = MM_conn_heinone n_STRING
For N = ins_rs_fakturer a+1 To rs_fakturera_to tal
found = false
For i = 0 To UBound(FX_field s)
If (cStr(Request.F orm(FX_fields(i )&N)) <"" Or FX_altv = true) Then
found = true
Exit For
End If
Next
If (found = true) Then
If (Request.Form(" txt_egen_faktur atext"&N) <"") Then s1 =
Replace(Request .Form("txt_egen _fakturatext"&N ),"'","''") Else s1 = "" End If
If (Request.Form(" hiddenField_dau m"&N) <"") Then s2 =
Replace(Request .Form("hiddenFi eld_daum"&N),"' ","''") Else s2 = "" End If
If (Request.Form(" hiddenField_man ad_ar"&N) <"") Then s3 =
Replace(Request .Form("hiddenFi eld_manad_ar"&N ),"'","''") Else s3 = "" End If
If (Request.Form(" hiddenField_eft ernamn"&N) <"") Then s4 =
Replace(Request .Form("hiddenFi eld_efternamn"& N),"'","''") Else s4 = "" End
If
If (Request.Form(" hiddenField_for namn"&N) <"") Then s5 =
Replace(Request .Form("hiddenFi eld_fornamn"&N) ,"'","''") Else s5 = "" End If
If (Request.Form(" hiddenField_kun d_id"&N) <"") Then s6 =
Replace(Request .Form("hiddenFi eld_kund_id"&N) ,"'","''") Else s6 = "0" End If
If (Request.Form(" hiddenField_hyr esbostad"&N) <"") Then s7 =
Replace(Request .Form("hiddenFi eld_hyresbostad "&N),"'","' '") Else s7 = "0"
End If
If (Request.Form(" hiddenField_bos tadsnamn"&N) <"") Then s8 =
Replace(Request .Form("hiddenFi eld_bostadsnamn "&N),"'","' '") Else s8 = "" End
If
If (Request.Form(" hiddenField_nar adress"&N) <"") Then s9 =
Replace(Request .Form("hiddenFi eld_naradress"& N),"'","''") Else s9 = "" End
If
If (Request.Form(" hiddenField_tel efon"&N) <"") Then s10 =
Replace(Request .Form("hiddenFi eld_telefon"&N) ,"'","''") Else s10 = "" End If
If (Request.Form(" hiddenField_fak turatext"&N) <"") Then s11 =
Replace(Request .Form("hiddenFi eld_fakturatext "&N),"'","' '") Else s11 = ""
End If
If (Request.Form(" hiddenField_man adshyra"&N) <"") Then s12 =
Replace(Request .Form("hiddenFi eld_manadshyra" &N),"'","''" ) Else s12 = "" End
If
If (Request.Form(" hiddenField_fin sk"&N) <"") Then s13 =
Replace(Request .Form("hiddenFi eld_finsk"&N)," '","''") Else s13 = "" End If
If (Request.Form(" hiddenField_pos tnr"&N) <"") Then s14 =
Replace(Request .Form("hiddenFi eld_postnr"&N), "'","''") Else s14 = "" End If
If (Request.Form(" hiddenField_pos tadress"&N) <"") Then s15 =
Replace(Request .Form("hiddenFi eld_postadress" &N),"'","''" ) Else s15 = "" End
If
If (Request.Form(" hiddenField_bet alningstid"&N) <"") Then s16 =
Replace(Request .Form("hiddenFi eld_betalningst id"&N),"'","''" ) Else s16 = ""
End If
If (Request.Form(" hiddenField_mom s"&N) <"") Then s17 =
Replace(Request .Form("hiddenFi eld_moms"&N),"' ","''") Else s17 = "0" End If
If (Request.Form(" hiddenField_bet ald"&N) <"") Then s18 =
Replace(Request .Form("hiddenFi eld_betald"&N), "'","''") Else s18 = "0" End If
On Error Resume Next
insert_Multi.Co mmandText = "INSERT INTO faktura (egen_text, datum,
manad_ar, efternamn, fornamn, Kund_ID, Hyresobjekt_id, hyresbostad,
naradress, telefon, text_pa_faktura , manadshyra, finsk, postnr, postadress,
betalningstid_d agar, moms, betald) VALUES ('"+s1+"', '"+s2+"', '"+s3+"',
'"+s4+"', '"+s5+"', "+s6+", "+s7+", '"+s8+"', '"+s9+"', '"+s10+"',
'"+s11+"', '"+s12+"', '"+s13+"', '"+s14+"', '"+s15+"', '"+s16+"', "+s17+",
"+s18+")"
insert_Multi.Ex ecute
If (Err.Descriptio n <"") Then
FX_sqlerror = FX_sqlerror & "Row " & N & ": " & Err.Description &
"<br><br>"
End If
End If
Next
insert_Multi.Ac tiveConnection. Close
thispath = cStr(Request.Se rverVariables(" SCRIPT_NAME"))
If (FX_insredir = "") Then FX_insredir = Mid(thispath, InstrRev(thispa th,
"/")+1) End If
If (Request.QueryS tring <"") Then
ch = "&"
If (InStr(FX_insre dir,"?") = 0) Then ch = "?" End If
FX_insredir = FX_insredir & ch & Request.QuerySt ring
End If
If (FX_sqlerror <"") Then
Response.Write( "<font color=""red"">" &FX_sqlerror &"</font>")
Else Response.Redire ct(FX_insredir) End If
End If
%>
<!--#include file="ewconfig. asp"-->
<!--#include file="db.asp"-->
<!--#include file="fakturain fo.asp"-->
<!--#include file="advsecu.a sp"-->
<!--#include file="aspmkrfn. asp"-->
<!--#include file="ewupload. asp"-->
<%
If Not IsLoggedIn Then Response.Redire ct "login.asp"
%>

<!--#include file="header.as p"-->
<p><form ACTION="<%=MM_e ditAction%>" METHOD="POST" name="form_fakt urera"
class="ewTable" id="form_faktur era">
<br />
Skriv in text som syns p&aring; varje faktura denna m&aring;nad:
<br />
<input name="faktura_i d" type="hidden" id="faktura_id " value="">
<% ins_rs_fakturer a = ins_rs_fakturer a+1 %>
<textarea name="txt_egen_ fakturatext" cols="60" rows="2"></textarea>
<table width="98%" border="0" cellspacing="0" class="ewTable" >
<tr class="ewTableH eader">
<th scope="col"><di v align="left">Na mn</div></th>
<th scope="col"><di v align="left">Hy resbostad</div></th>
<th scope="col"><di v align="left">N& auml;radress</div></th>
<th scope="col"><di v align="left">Te lefon</div></th>
<th scope="col"><di v align="left">Fa kturatext</div></th>
<th scope="col"><di v align="left">M& aring;nadshyra</div></th>
<th scope="col"><di v align="left">Mo ms</div></th>
</tr>
<%
While ((Repeat1__numR ows <0) AND (NOT rs_fakturera.EO F))
%>
<tr >
<td>
<%=(rs_fakturer a.Fields.Item(" Efternamn").Val ue)%>&nbsp;<%=( rs_fakturera.Fi elds.Item("Forn amn").Value)%>
<input name="hiddenFie ld_daum<%=ins_r s_fakturera%>"
type="hidden" id="hiddenField _daum" value="<%=date( )%>">
<input name="hiddenFie ld_manad_ar<%=i ns_rs_fakturera %>"
type="hidden" id="hiddenField _manad_ar" value="<%=month (now) & "_" &
year(now)%>">
<input name="hiddenFie ld_efternamn<%= ins_rs_fakturer a%>"
type="hidden" id="hiddenField _efternamn"
value="<%=(rs_f akturera.Fields .Item("Efternam n").Value)%> ">
<input name="hiddenFie ld_fornamn<%=in s_rs_fakturera% >"
type="hidden" id="hiddenField _fornamn"
value="<%=(rs_f akturera.Fields .Item("Fornamn" ).Value)%>">
<input name="hiddenFie ld_kund_id<%=in s_rs_fakturera% >"
type="hidden" id="hiddenField _kund_id"
value="<%=(rs_f akturera.Fields .Item("Id").Val ue)%>"></td>
<td><%=(rs_fakt urera.Fields.It em("Namn").Valu e)%>
<input name="hiddenFie ld_hyresbostad< %=ins_rs_faktur era%>"
type="hidden" id="hiddenField _hyresbostad"
value="<%=(rs_f akturera.Fields .Item("Hyresbos tad").Value)%>" >
<input name="hiddenFie ld_bostadsnamn< %=ins_rs_faktur era%>"
type="hidden" id="hiddenField _bostadsnamn"
value="<%=(rs_f akturera.Fields .Item("Namn").V alue)%>"></td>
<td><%=(rs_fakt urera.Fields.It em("Naradress") .Value)%>
<input name="hiddenFie ld_naradress<%= ins_rs_fakturer a%>"
type="hidden" id="hiddenField _naradress"
value="<%=(rs_f akturera.Fields .Item("Naradres s").Value)%> "></td>
<td><%if (rs_fakturera.F ields.Item("tel efon").Value) <"" then%>
<%=(rs_fakturer a.Fields.Item(" telefon").Value )%>&nbsp;
<%if (rs_fakturera.F ields.Item("mob iltelefon").Val ue) <""
then%>
<%=(rs_fakturer a.Fields.Item(" mobiltelefon"). Value)%>
<%end if
end if
%>
<input name="hiddenFie ld_telefon<%=in s_rs_fakturera% >"
type="hidden" id="hiddenField _telefon" value="<%if
(rs_fakturera.F ields.Item("tel efon").Value) <"" then%>
<%=(rs_fakturer a.Fields.Item(" telefon").Value )%>&nbsp;
<%if (rs_fakturera.F ields.Item("mob iltelefon").Val ue) <"" then%>
<%=(rs_fakturer a.Fields.Item(" mobiltelefon"). Value)%>
<%end if
end if
%>"></td>
<td><%=(rs_fakt urera.Fields.It em("text_pa_fak tura").Value)%>
<input name="hiddenFie ld_fakturatext< %=ins_rs_faktur era%>"
type="hidden" id="hiddenField _fakturatext"
value="<%=(rs_f akturera.Fields .Item("text_pa_ faktura").Value )%>"></td>
<td><%=(rs_fakt urera.Fields.It em("Manadshyra" ).Value)&":-"%>
<input name="hiddenFie ld_manadshyra<% =ins_rs_fakture ra%>"
type="hidden" id="hiddenField _manadshyra"
value="<%=(rs_f akturera.Fields .Item("Manadshy ra").Value)%> ">
<input name="hiddenFie ld_finsk<%=ins_ rs_fakturera%>"
type="hidden" value="<%if (rs_fakturera.F ields.Item("Fin sk").Value) = True
then response.Write(-1) else response.Write( "0")%>">
<input name="hiddenFie ld_postnr<%=ins _rs_fakturera%> "
type="hidden" id="hiddenField _postnr"
value="<%=(rs_f akturera.Fields .Item("postnr") .Value)%>">
<input name="hiddenFie ld_postadress<% =ins_rs_fakture ra%>"
type="hidden" id="hiddenField _postadress"
value="<%=(rs_f akturera.Fields .Item("postadre ss").Value)%> ">
<input name="hiddenFie ld_betalningsti d<%=ins_rs_fakt urera%>"
type="hidden" id="hiddenField _betalningstid"
value="<%=(rs_f akturera.Fields .Item("Betalnin gstid_dagar").V alue)%>"></td>
<td><center>
<input name="hiddenFie ld_moms<%=ins_r s_fakturera%>"
type="hidden" value="<%if (rs_fakturera.F ields.Item("mom s").Value) = True
then response.Write(-1) else response.Write( "0")%>">
<%if (rs_fakturera.F ields.Item("mom s").Value) = True then
response.Write( "Ja") ELSE response.Write( "Nej")%>
<input name="hiddenFie ld_betald<%=ins _rs_fakturera%> "
type="hidden" id="hiddenField _betald" value="">
</center></td>
</tr>
<%
Repeat1__index= Repeat1__index+ 1
Repeat1__numRow s=Repeat1__numR ows-1
rs_fakturera.Mo veNext()
Wend
%>

</table>
<br>
<table width="98%" border="0" cellspacing="0" class="ewListAd d">
<tr>
<td><div align="right">
<input type="submit" name="Submit" value=" Fakturera
&raquo;&raquo;" >
</div></td>
</tr>
</table>
</form>
<!--#include file="footer.as p"-->
<%
rs_fakturera.Cl ose()
Set rs_fakturera = Nothing
%>

Dec 19 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
11808
by: Ralph Freshour | last post by:
I'm trying to add images to a TEXTAREA tag (in my PHP web page) using the usual image tag: <INPUT TYPE="image" etc. But the images are not showing up in the TEXTAREA but rather outside, below it - I'm trying to display thumbnail images in a scrolling area on the web page so I can insert a variable number of images into the TEXTAREA...
9
9335
by: Hal Halloway | last post by:
I want a text editor inside a form's textarea, So I would see html markup and html entities - just like a text editor. I also would want to be able to edit it all just like a text editor - this is done in PHPMyadmin for example...is there an easy way to do this? In a way i'm asking the browser to suspend rendering markup.
2
1520
by: Jack | last post by:
Hello, <%@ Language=VBScript %> <% Response.Write "<FORM name=form1>" Response.Write "<TEXTAREA rows=2 cols=20 id=textarea1 name=textarea1></TEXTAREA>" %> <Script language=JavaScript> document.form1.textarea1.value="ABC"&chr(13)&"DEF" </Script>
1
2315
by: yawnmoth | last post by:
say i have a form where, if a user clicks in it, all the text is highlighted, and where, if a user clicks on a button outside of the form, a certain text string is inserted where the cursor in the textarea is. why is it, then, that when i, immediatly after loading the page, click in the textarea, highlighting the text, click again in the...
5
2633
by: yawnmoth | last post by:
say i have a form where, if a user clicks in it, all the text is highlighted, and where, if a user clicks on a button outside of the form, a certain text string is inserted where the cursor in the textarea is. why is it, then, that when i, immediatly after loading the page, click in the textarea, highlighting the text, click again in the...
11
13676
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom, there's an "Edit" link. So the page itself looks something like this: <HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY> <!-- TEXT STARTS HERE --> ...
6
5972
by: wperry1 | last post by:
I am writing a small database utility to catalog all of my favorite ASM/JS/VBS... functions and scripts on an asp page. Everything is going smoothly except for one thing that I can't quite seem to think my way around. I am using a <textarea> to display the code but some of my scripts have <textarea> tags in them and when the </textarea> tag...
4
3169
by: jim | last post by:
Hi, I have a form that accepts free text from users in a single textarea field. I would like for a select list of words (15 or so) to autopopulate as the user types. For example, instead of typing "customer" the user could type "cu" and the form finish it for him/ her. I know how to set autocomplete for a single text field, but don't...
7
2117
Haitashi
by: Haitashi | last post by:
This is in the head: <script language="javascript" type="text/javascript"> function limitText(limitField, limitCount, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.value = limitNum - limitField.value.length; } } </script>
0
7854
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8296
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6533
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5349
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3790
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3806
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1118
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.