Textarea outside of loop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jen

    Textarea outside of loop

    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?


  • Slim

    #2
    Re: Textarea outside of loop

    need to see your code


    "Jen" <jen@hoganmail. comwrote in message
    news:%23c5OiD2I HHA.4000@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?
    >
    >

    Comment

    • Bob Barrows [MVP]

      #3
      Re: Textarea outside of loop

      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"


      Comment

      • Slim

        #4
        Re: Textarea outside of loop


        "Bob Barrows [MVP]" <reb01501@NOyah oo.SPAMcomwrote in message
        news:uD%23C8e2I HHA.4384@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"
        >

        Comment

        • Jen

          #5
          Re: Textarea outside of loop

          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"
          >

          Comment

          • Slim

            #6
            Re: Textarea outside of loop


            "Jen" <jen@hoganmail. comwrote in message
            news:OX%23ZP43I HHA.3552@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"
            >>
            >
            >

            Comment

            • Bob Barrows [MVP]

              #7
              Re: Textarea outside of loop

              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.


              Comment

              • Jen

                #8
                Re: Textarea outside of loop

                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>


                Comment

                • Bob Barrows [MVP]

                  #9
                  Re: Textarea outside of loop

                  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.


                  Comment

                  • Jen

                    #10
                    Re: Textarea outside of loop

                    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
                    %>





                    Comment

                    • Bob Barrows [MVP]

                      #11
                      Re: Textarea outside of loop

                      Jen wrote:
                      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.

                      Now we have a fundamental problem. Nothing server-side can be refreshed
                      without a form submission. This is pretty basic. In order for something
                      to happen on the server, something has to be sent to the server.

                      Using an xmlhttp object, data can be submitted to the server without
                      leaving/refreshing your page. This again is client-side code so I'm
                      going to ask you to google the subject and post any further question you
                      have to a client-side group.



                      --
                      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.


                      Comment

                      • Jen

                        #12
                        Re: Textarea outside of loop

                        Now we have a fundamental problem. Nothing server-side can be refreshed
                        without a form submission. This is pretty basic. In order for something
                        to happen on the server, something has to be sent to the server.
                        >
                        Using an xmlhttp object, data can be submitted to the server without
                        leaving/refreshing your page. This again is client-side code so I'm
                        going to ask you to google the subject and post any further question you
                        have to a client-side group.
                        >
                        Please, I do understand this server-side/ client-side refresh problem, thats
                        the core of my problem, no need to stress this out forever and ask me to
                        leave the group only if you don't have the answer to my initial basic
                        question. The refresh-thing wont work.


                        You were basically wrong in your earlier statements?:

                        "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?"
                        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.
                        I still don't understand why that [popup] would be relevant."

                        Thanks for taking the time to answering though and happy holidays to you.

                        Anybody else that could answer this initial question of mine:?
                        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.
                        A screenshot can be found here: http://www.comtech.fi/filer/example.gif
                        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.

                        Jen.


                        Comment

                        • Jen

                          #13
                          Re: Textarea outside of loop

                          Got it working using a popup window. Thanks to all and a merry christmas.

                          Jen.


                          Comment

                          • Slim

                            #14
                            Re: Textarea outside of loop

                            There was no need to use a popup window. Popups are messy way to gain input

                            Can we see the code of your popup window?

                            Is this code produced by some sort of editor?


                            "Jen" <jen@hoganmail. comwrote in message
                            news:%23Rm4U7AJ HHA.4068@TK2MSF TNGP03.phx.gbl. ..
                            Got it working using a popup window. Thanks to all and a merry christmas.
                            >
                            Jen.
                            >

                            Comment

                            • Jen

                              #15
                              Re: Textarea outside of loop

                              Slim, instead of keeping asking a lot, giving everyone an image of that you
                              are so good at this and never telling anything of value anyway, you got the
                              code you asked for before, why don't you show how to do this without the
                              popup window? :)

                              Jen.

                              "Slim" <me@here.comwro te in message
                              news:%2346$Q3BJ HHA.2312@TK2MSF TNGP02.phx.gbl. ..
                              There was no need to use a popup window. Popups are messy way to gain
                              input
                              >
                              Can we see the code of your popup window?
                              >
                              Is this code produced by some sort of editor?
                              >
                              >
                              "Jen" <jen@hoganmail. comwrote in message
                              news:%23Rm4U7AJ HHA.4068@TK2MSF TNGP03.phx.gbl. ..
                              >Got it working using a popup window. Thanks to all and a merry christmas.
                              >>
                              >Jen.
                              >>
                              >
                              >

                              Comment

                              Working...