How To Display Multiple Form Fields In Email Using This Script?
I am using this script to submit my form fields into the body of my email:
*********************************************** Dim strBody dim ix, formElementName, formElementValue strBody = "Results of form submitted at " & Now() & vbCrLf & CrLf For ix = 1 to Request.Form.Count formElementName = Request.Form.Key(ix) formElementValue = Request.Form.Item(ix) strBody = strBody & (formElementName & ": " & formElementValue & vbCrLf) Next
*********************************************** I'm completely new to vbscript and have been searching all over the net for an example of this script being used with mutliple fields with absolutely no luck.
The closest I've come to getting something back from this thing is when I tested the script with these elements:
FormElementName = Request.Form.Key("Name") formElementValue = Request.Form.Item("Name") formElementName = Request.Form.Key("Telephone") formElementValue = Request.Form.Item("Telephone") formElementName = Request.Form.Key("Email") formElementValue = Request.Form.Item("Email")
Which produced this result:
Email: Email Email: Email Email: Email
Its seems the answer to my problem lies in defining the 'Key' and possibly the 'Item' parameters but I haven't been able to find any documentation on these terms. Can someone out there please save me from what probably is a very simple solution?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Display Form Fields
I have created an email form in which all fields must be completed. If all the fields are not completed "submit" causes a refresh using response.redirect, Problem is allthe fields that were previously filled in are empty.How do I keep the values of the fields on refresh?
Search DB Based On Multiple Form Fields On Submit??
I have a form on one page where someone selects a bunch of options and details about a specific category. Then on the next page they fill out a form with contact information, name, address, email, etc. Well what I want to know is when they click Submit on that contact form is there a way to have it so it goes through and searches the database for any that match the state and county(which they will select from a )?? So what I basically want right now is for the first form to be filled out, then the second form to be filled out, then when they are submitted it will go through the database and select everyone in there with that state and county, then on the next page display the results of both forms AND the matches in the db(obviously whatever fields I want it to display). I already have both forms(basic html), I already have the dynamic dropdown for state and county(classic asp), what Im wondering is how do I put that dynamic dropdown in the contact form and then when submitted it will go through and search the db based on what was selected there. Would this be some sort of onClick for the submit button tellin it to search the db based on the dropdown or how would I get started on something like this? There will be other information on the dropdown like name address email so one problem I was wondering about was my dropdown menu. When you select the state it refreshes the page and then loads the counties, so wouldnt that erase anything that was filled out on the form? I could make it so they actually type the name of their state and county but that causes problems too because if they mispell either then it wont return any results.
ASP Repeating Form Fields In An Email Form
Would anyone be able to give some guideance in ASP code as to how I would repeat a section of input fields in a form based upon the number of guests that are attending an event? Basically, what needs to happen is if 3 guests are attending, I need the Name, address, city, state fields to repeat so they can be filled in with information. Then all of the information from the whole form is submitted which returns an email to the administrator of the event.
Syntax To Have Body Of Email Include Form Fields
I finally figured out how to get my form to its database and have an email come my way. However I am now trying to set up the body of the email to include the form details. However the body of the email that is sent only includes the last line of the "body" tag and has no details next to it. Code:
Asp Page Wont Send Email If Form Fields Are Blank
I created a feedback form for my website that has only 2 required fields. When you submit the form it calls my asp page which puts the information in a database and then sends me n email with the information that was entered into the form. The problem is that the form only has two required fileds, and if the remaining non required fields are left empty when the asp page is called it does write to the data base, but does not send me any email. However if I go back in and put somethng in every field in the form then when I submit the form and my asp page is called it writes to the data base and sends me an email with the all the information I entered in the feedback form. Is there a way to tell my asp page that it is ok to send the email even if the non required fields are left empty? I really do not want to have to go back through the form and put default values in for each area of the form? Also is there a way to have an error displayed if the email is not sent? My asp code is below....
Searching Multiple Memo Fields In Multiple Tables In Access
I have a search option on my website, which should perform a search on 4 fields, as follows: tblNews headline content tblDatabank filename description It only needs to return matches which are an exact match of their search criteria. For instance, searching for "I am here" would return a record which contained "I am here", but not just "I" or "I am" etc. I need to return all these records as part of one recordset preferably, as I want to be able to order them etc., though I imagine you may suggest I use an array somehow to merge two recordets etc., then reorder them?
Display The Fields Of The Recordsource
I want to build a site that I can manipulate from Access and have the changes show up on the ASP page. For Example: I have Table A that has four fields in it. ID Name Date Phone I change the table to include another field, say SSN. Is there a way that I can build my ASP page to do a loop everytime it opens to looke for new fields and display that as another part of the page? I understand loops and If statements I just need to know the right code for listing the fields of the recordsource.
Dynamically Display The Fields
I have been given the task to create a search page to search on of the tables in the sql database. I have been asked that the user should be able to search any field(which I have done) but he should also be able to customise the form to display or hide any feilds in the results. My table has about 20 feilds and different users wanting to you the search page will like to see different set of fields.
Set Multiple Fields
I need to set up my front end app to update multiple fields with the same entry. See below. Database: Testing Columns: Recdte Invdte So in this case, the user would need to update the Invdte with the current date for all rows where the Recdte is a given value. I know how to do this in SQL but not in ASP.
Inner Join Multiple Fields
how to inner join multiple fields. I have 1 table SCHEMA1 wich contains: id|wedstrijd|speler1|speler2|speler3|speler4 1 1 1 2 3 4 2 2 2 1 4 3 The other table SPELERS contains id|speler|naam 1 1 Jan 2 2 Piet 3 3 Klaas 4 4 Henk I would like to have te next result: wedstrijd|speler1|speler2|speler3|speler4 1 jan piet klaas henk 2 piet jan henk klaas Can anybody help, because i'm lost......?
Sql Update Multiple Fields
Is it possible to do an update on a recordset like this?display all the fields in a form and let the user pick which ones to update? What happens if they pick, say, two of the total to update, and leave the rest of the form fields blank? Would that update the chosen records and leave the rest of them blank or null?
Select Different Fields In Multiple Tables
I have 4 tables first table category (category_id and category name in it) second table artist (artist_id, category_id, artistname in it) third table album (id, artist_id, album_title in it) forth table song (id, album_id, title in it) I'm selecting category in first page I'm selecting artist in second page I'm selecting album in third page I'm requesting, collecting and posting all id's to the next page. this is the question!! How can I read from database 1- category name when I was selected in first page 2- artist name when I was selected in second page 3- album name when I was selected in third page
Getting Multiple Records Fields In One Variable
I've got 4 records in my lovely database table. The table contains 5 fields, lets say: id, number, name, age and sex. All I want to do is to get all the values (form all 4 records) of the "number" field and put all 4 of the values in to one variable. The output have to look something like this : numbers: 001, 002, 003, 004. I tired, honestly, I really did. But didn't find a solution.
Passing Hidden Fields Into Multiple Forms
I'm having trouble passing hidden fields between forms. I have a total of four forms. I have the 1st form passing its field to the 2nd form, and the 2nd form passing its field to the 3rd form, but the 1st form's field then is not passed into the 3rd form. So obviously, my summary form (the 4th form) is not getting the 1st form's field or the 2nd form's field, only the 3rd form's field. Code:
Display Multiple Lines
Can anybody give me some tips on the best and/or easiest way to display multiple lines in a field. The data is collected from a "textarea" field when the form is submitted, and I want to display all of the data (multiple lines) in a resulting HTML page. The data displays on a single line (obviously) and does not wrap without manipulation of the string variable. Is there an easier way to display the data?
Display One Object Multiple Times
The object I have is a barcode: <% RMABarCode = Session("rmaID") IF Len(RMABarCode) Then response.write "<img src='barcode.asp?code=" & RMABarCode & "&height=25&width=1&mode=code39'>" End If %> But I need to be able to display that barcode multiple times. Say the user needs 4 displayed, he/she will enter the number and it shows that many.
Display Multiple Data On Hyperlink In ASP
how can I display multiple access data on hyperlink in ASP?? For example like I click on Monday link it will only display all the informaton about Monday and click tuesday will only display tuesday information on same page.
Combine List Menu Fields For Email Output
I am using asp to submit a form I've created in asp. I was wondering if there was a way to output the vlaues of three listbox menus. 1. User selects hour 2. user selects minute 3. user selects am/pm This is now outputting into my strBody as seperate entries. I'd like to combine them into one entry within the strBody. Please reference strStartTime, I've tried to incorporate this into the email strBody, but am unable to accomplish this. Any help would be appreciated. Thanks Everyone!!! Here is the asp code for the form: ......
Form Fields
I have an asp page which has a number of form fields on it (about 50). 2/3rds of these fields are used to store username (windows username) and date (todays date). I want these fields to be locked so the user cannot enter any info into them. The infor will be grabbed from the current user and the current date. However, I only want these fields to be populated only when the left most field is changed. Once the fields have been populated the username and date fields will change with however is logged in and the new date.
Loop Form - Extract Display 'value' As Well As Form Value?
While I can extract the option value from the following: <Select name='Keystring' MULTIPLE> <option value='1' name='status'>Pending</option> ..... </select> I cannot seem to extract the corresponding 'display' value when I do a For...Next Loop: for each keystring in Request.Form("Keystring") keystring=request("keystring") Next How do I aslo get hold of that 'display' value eg 'Pending'...is it possible?
Form Fields To 1 Variable
I need to loop through all submitted form fields and place them all into 1 variable but i have no idea how. Here's what I have so far: for each item in request.form myVariable = "formfieldname:" & item & "formfieldvalue:" & request(item) next response.write(myVariable) The problem with that is that response.write(myVariable) only prints the last field in the form. I know that if I move the response.write(myVariable) INSIDE of the loop it will print correctly but I am not trying to print the form fields BUT I AM TRYING to store them in ONE variable. For example: myVariable = formfield1name:formfield1value:formfield2name:formfield2value:formfield3name:f ormfield3value:ETC ETC
Not Getting Form Fields Thru ASP (CDOSYS)
Code to email form data via ASP. Forced to use CDOSYS by 2003 server at host. It sends an email fine, but the form data is missing. Where my going wrong? Could it be the html file's form actuating the .asp file? Could it be an enctype issue? Or bad ASP syntax... Code:
Bunch Of Form Fields
Can someone tell me how I can take a bunch of form fields using Request.Form, and put them in a array. And then, how do I send that in and INSERT sql.
Insert Form Fields
I have about 30 names of workers (and their IDs in hidden fields, that depend on their departments) in one form, beside them there is one dropdown list for each worker, with same items. I want to select item from dropdown list for each worker, that will write item ID in another hidden field... and then I want to submit worker's ID, ID from dropdown list etc....into another .asp page and sql db. If I use next way : <% FOR EACH name IN Request.Form Response.Write("<BR>") Response.Write(Request.Form(name)) NEXT %> I get only values of IDs from dropdown lists. But I need workers' IDs, too.
How To Send All Fields Of A Form Without Specifying Each One
how can I send the whole form using the script below, without listing every NAME of the form. Basically I wondered if you can just put a certain code in that will send all the fields of the form without putting each NAME of the fields down indiv individualy?? My forms Name is 'conf', so I was wondering if there was a code like SENDWHOLEFORM="conf", (I know it obviously won't be that, but just to put the point across!) <% DIM strNAME, Mailer strFirstName = Upload.Form("NAME") Set JMail = Server.CreateObject("JMail.SMTPMail") JMail.ServerAddress = "10.2.3.2" JMail.AddRecipient "me@me.com" JMail.Sender = "me@me.com" JMail.Subject = "Submitted Item to sell" JMail.Body = "Name: " & strNAME JMail.Execute Set JMail= Nothing %>
How To Loop Through More Form Fields?
I have about 30 worker names (and their IDs in hidden fields) in one form, beside each worker I have a dropdown list with same items. When I select an item from dropdown list its ID is written in another hidden field. I want to submit values from hidden fields into another .asp page and sql db. If I use : <% FOR EACH name IN Request.Form Response.Write("<BR>") Response.Write(Request.Form(name)) NEXT %> I get only values from dropdown lists IDs. how to loop through all fields and get IDs of workers, too.
Dislpaying SQL Fields In A Form
I have the following asp code: response.write "<td align=left colspan=2 class=text>" & _ "<input type=text name=ProjectDescription STYLE='width:465px' value=' " & ProjectDescription &" '>" & _ "</input></td>" The problem I have is when ProjectDescription contains a ' the data gets truncated. How can I resolve this. i.e. ProjectDescription=doesn't
Scanning Form Fields
I have a form submitted with a form field called contents. This could have loads of text in. What i need to do is scan this field for words that match the text in a database record called PAC_WORD. This could match 3 or 4 of the words put. Basically for each word picked up I want to write " This item found is not allowed
Server Form Fields
I have a asp page that has a form that I have to submit to a third party website.if their is a way to create form values using asp to submit the secure data without having it in a hidden field where it can be seen when viewing page source? Currently I have my asp code writing out hidden form fields using the response.write when the page loads then after everything is loaded JavaScript submits the form.
Update Fields In Form
I am creating a form that uses a postcode lookup that opens in another window to confirm an address how would I pass back the address and populate the form?
Form Fields Visibility
I have a web form which is quite long. My first field is required. If my user submits the form the page just sits there and the do not see my validation message at the top of my page. how I can reposition teh page so they see teh message i.e.scroll back up the page?
HTML Form Fields
how to access my HTML form fields from ASP. i don't know how to access HTML form fields from ASP code.
Hidden Form Fields
i wrote a script in asp/vb script that validates form fields. all works fine, apart from the fact that alerts are being shown against the empty form fields when the page loads the first time. so, validation should not be carried out when the page loads the first time. my friend challenged me and said i can achieve this "using a hidden form field or even the submit button" and submitting the page to itself i was more thinking of using session variables or a session cookie, but does anyone know how you could accomplish this using a hidden form field?
Updating The Fields From A Form
Here's what I want to do ... or here's my problem. I have a 'ICQ' on my user's profile, so it's a number, now when I update the database it DOES NOT use the single quotes, so it looks like: & "ICQ = " & Trim(FormatStr(Request.Form("ICQ"))) & ", " _ Now, the prob with it is when a user DOES NOT type anything in it, since he doesn't have a ICQ number, then it gives a syntax error because your inserting nothing without any single quotes. How do i fix it? Or how can I NOT make it update if it doesn't have anything in the text box?
How To Send Blank Fields On Form
I have created a database were you submit a job by entering the fields which is fine if it is a site visit but if it is a phone call or remote help not all the fields need to be filled in but if there not filled in it wont submit the values to the database i get data mismatch error code is below. I either need to be able to send them blank values to the database or ideally i wont to create a option box with Phone call, Site visit and remote help which when selected takes you to the correct page which have different values in the form to fill in.
Loop Through Form Fields To Set Cookies
I have a table in which I count the rows, and for each record it finds it uses that number to dynamically name the form field. i.e. <input type=text name="FirstName<%=i%>"> I got that to work just fine. What I'm trying to do now, is post the form, and on the new page dynamically create cookies based on the number of form fields there are. For example, my desired end result would look something like this.. response.cookies("First0")=request.form("FirstName0") response.cookies("First1")=request.form("FirstName1") and so on. Is there a way to do this by looping, instead of hardcoding? I have my feeble attempt below....
Populating Form Fields From A Database
i have a form with fields that contain data from a db. the fields can then be edited, and on the click of the "submit" button, the updated information is returned to the database, replacing the old. a bonus would be arrow buttons allowing navigation from one record to the next, with the information populating the form each time. i'm having a hard time with this.
Requesting Many Looped Fields From A Form
I have an asp form page that has alot of textboxes on it and are displayed in a looped table, meaning that the number of fields submitted will vary each and every time the form is submitted. I do not know how to pick up these fields on my submit page. Normally I would just use request.form("fieldname") but since i dont know how many fields will be submitted, its hard to bring in the field values that way. there is only 1 field on my form but there could be alot of that 1 field because of the loop. I managed to name each field txtEmail1, txtEmail2, etc... Code:
Clearing Form Fields Value Button.
I have a form that comes up pre-filled with database results for the values. I'd like to add a button, though, that will clear all fields to start blank if desired. A standard "reset" button, will only clear input that has been typed in, but won't clear the initial values. Does anyone have a script already that does this or could someone get me started on how I could do this?
Passing ASP Via Hidden Form Fields....
I want to pass ASP returned values via hidden form fields... Here is a simpler demo of my what I am trying to do.... Page containg asp values in hidden fields of a form: (input.asp) <html> <body> <form method = "post" action="ad.asp"> <input type = "hidden" value = "adski" name = "ad1"> <input type = "hidden" value = ""<%= WeekDayName(Weekday(Date)) %>"" name="ad2"> <input type = "submit" value="submit" name = "submit"> </body> </html> Output page, showing passed ASP values:
Request.Form With Unknown Fields?
I need to create a script that will collect any variables sent by a form. Reason: A company that I work for wants to have a script that they can pretty much send any HTML form to that will send them an email with the results. So if they make a new form with different form fields next week, they can point it to the same script. Is there anything in ASP that can "Just collect Anything/Everything" that is sent from the form?
Repeat Region - Form Fields
I am displaying multiple records returned in a resultset using a Do While loop. I've set the form field names like the following: <select name="fieldnameA<%=ID%>"... where <%=ID%> is a hidden field on the page that holds the id value for each record. I want to append that number to the end of each form field So, "fieldnameA" would be fieldnameA1 or fieldnameA2, etc. I thought this would work, but the field names remain the same for every record...i.e. fieldnameA just repeats and the hidden field value isn't appended to the end of the field name. Is there a way to append the value of the hidden field to the end of the form fields? So, the form field names are different for each new record displayed?
Posting Form Fields With XMLHTTP
I am trying to post a large XML string to another url. I have been doing this previously in cold fusion but am trying to get all of my code up to date and it wont work in ASP. It should be very simple: xml = Server.URLEncode(refi1_doc) pingUrl = "https://xxx.xxxxxxx.com/b2b/incoming.asp" set xmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP") xmlHttp.Open "POST", pingUrl, False xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" xmlHttp.Send xml This should just be URLEncoding the xml document and posting it. I am getting a "Bad XML" response - line 0, position 0 -- but I KNOW the xml string is well formed -- have already tested that. The guy on that end who was trying to help me stated that the string MUST be in a form field named "xml" (all lowercase) and it has to be a post -- that's it! Isn't that what I am doing? I even tried adding to the end of the URL: pingUrl = "https://xxx.xxxxxxx.com/b2b/incoming.asp?xml=" Nothing is working. How do I specify that the data being sent is in a form field called "xml"? Anyone know what is going on here?
Referencing (many) Form Fields In An Array
I am trying to do some client-side form validation using vbscript. The form consists of 15 rows, with five fields in each row. For example, I want to be able to look at the contents of the 3rd field in the 9th row. How do I reference that field using vbscript? Do I loop through a collection?
Showing Calculated Fields In The Form
I have a asp input form of a financial report. Here most of the fields are text boxes where the user need to input the values corresponding to an item. However, there are few items which are calcuated field. Prior to submission of the information, I would like the user to know what the calculated field be (based on the information input in text boxes) before submission of the form. Is there any way to display the calculated value before submission in ASP?
|