Results 1 to 5 of 5

Thread: email

  1. #1
    Rashi Bansal Guest

    Default email

    Hi,<BR> I am facing one problem here. I have one form and it has about 30 input boxes and on submitting of that form, it should send an email. I am using form collection method for getting values of all the input boxes. I can get the values of those input boxes but I also want to get name of those input boxes along with their values. Could anyone please tell me how to do that?<BR><BR>Thanks

  2. #2
    Bill J Guest

    Default RE: email

    o.k. you can do this... but it deals with string editing.<BR><BR>Essentially do this.<BR><BR>QryString = Request.ServerVariables("QUERY_STRING")<BR>QryStri ngLen = Len(QryString)<BR><BR>Now you the ENTIRE querystring, now to get the names you do this<BR><BR>Name1Pos = InStr(0,QryString,"=")<BR>Name1 = Left(QryString, Name1Pos)<BR><BR>This gets you the name of the first item, to get to the second you&#039ll have to do this<BR><BR><BR>Name2Pos = InStr(0, QryString, "&")<BR>QryString = Right(QryString, QryStringLen - Name2Pos)<BR>Name2Pos = InStr(0,QryString,"=")<BR>Name2 = Left(QryString, Name2Pos)<BR><BR>And so forth, this will get you all the names, now you can also grabthe item themself this way as well, now since you have thirty I&#039d suggest modifying this code to fit you purpose, say a loop, that keeps going till QryString is empty....<BR><BR>but this will allow you to do what you want, also I&#039d suggest an array of names/values... but this you should be able to do.<BR><BR>Bill J.

  3. #3
    Rashi Guest

    Default RE: email

    I get the idea and I will try this. <BR>But what my actual thought was is to use POST method of the form and in action file use "For each item in request.form". This does give me the value but not the names of the input box (atleast I don&#039t know how). Is there any way to get to the names through that method.<BR>Thanks

  4. #4
    Bill J Guest

    Default RE: email

    &nbsp;<BR>hmmm... Try this<BR><BR>name = new array(0)<BR>value = new array(0)<BR>counter = 0<BR><BR>For Each item in Request.Form<BR>name[counter] = item<BR>value[counter] = Request.Form(item)<BR>Next<BR><BR>this should give you what you want... though don&#039t quote me on this...

  5. #5
    Rashi Guest

    Default RE: email

    Thanks.<BR>It worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts