Form Element 'key' Syntax (VBscript)
how I write this in VBScript (it doesn't like the 'key' object) Code:
<%
For i = 0 To Request.Form.Count - 1
Response.Write(Request.Form.Keys(i) & "=" & Request.Form.Item(i) & "</br>")
Next
%>
how I write this in VBScript (it doesn't like the 'key' object) Code:
<%
For i = 0 To Request.Form.Count - 1
Response.Write(Request.Form.Keys(i) & "=" & Request.Form.Item(i) & "</br>")
Next
%>
I have a form that has dynamically assigned element names. How would I do the following:
(original code)
sub OnControlLoad
set Control = Document.getElementById("MsRdpClient")
if Not Control is Nothing then
if Control.readyState = 4 then
Document.all.connectbutton.disabled = FALSE
end if
end if
end sub
I want to get this line
Document.all.connectbutton.disabled = FALSE
to loop and look like
Document.all.connectbutton1.disabled = FALSE
Document.all.connectbutton2.disabled = FALSE
Document.all.connectbutton3.disabled = FALSE
etc....up to a predefined value
I have a dynamic form sending information via name=value pairs.I know I can read the value of each element in the sending form by using the following....
for i = 1 to request.form.count
response.write "<p>" & request.form(i)
next
but since it's a dynamic entry page (it's built based on number of fields in a database), I need to know the name of each element also.not just the value.Is there a good way to get the "name" portion of the element on the form without having to parse through the request.form string?
I have noticed on some forms that when a user submits the form and there is a textarea element that a lot of extra whitespace is getting submitted at the end of the elements content. What's going on.
View Replies View Relatedi need to find some scrit to uploadimages but with multi elements form i mean i need to put some textboxes and compo boxes with the uploading form to process the data entered in the text boxes and copbo boxes something = the posting new thread u can write ur thread and choose file to attach hope it's clear.
View Replies View Relatedhow to create an array of checkboxes that were selected from a form on one page and pass them into hidden fields in a form on the next page? I have this massive project I've been working on and am having trouble with this.
View Replies View RelatedI have a ton of TD attributes that have to be changed based on the
data in the DB. All TD elements are ID and runat=server.
Changing the attributes of a SINGLE TD is simple:
<td id=thisTD runat=server>
thisTD.Attributes.Clear();
thisTD.Attributes.Add("Class",reader["thisTD_Class"].toString());
Now, say we have 100 TD elements with IDs TD_1 to TD_100
I have not been able to find a way to (essentially) say:
for(int i=0;i<100;i++){
"TD_"+i.Attributes.Clear();
"TD_"+i.Attributes.Add("Class",reader["TDClass"+i].toString());
}
in J-Script, I could do it by Eval() or about eight ways through the
DOM. It seems crazy to me that if I can access the Attributes of a
specific element directly by ID (thisTD.Attributes), I couldn't also
access it by reference.
But I have been able to find NOTHING to indicate how this may be done.
Obviously, my problem is not limited to a single attribute, or else I
would have just typed them all out by now. Trouble is, there is a lot
of logic that must be applied to the data before setting the
attribute. Without being able to iterate or loop by reference, I will
be typing for ages just to change some freaking classes.
I am trying to display data from three tables in an MS Access database. Here is my code:
View Replies View RelatedI can't seem to get this page to work. Its a basic form (with a lot of fields) and I need to insert part of the data into one table and part into another. Here is what is at the top before the <html>
tripreportR.asp
Code:
set
The form's action is to post to itself. I can't get the data in and I can't even get the page to show now. Any suggestions, ideas, links, resources would be great!
I having a problem with the CDO syntax I guess. Here's the code :
<%
response.buffer = true
message = "The following data was submitted:"
message = message & vbcrlf & vbcrlf
for each item in request.form
message = message & item & ": " & request.form(item) & vbcrlf
next
'Create message object
Dim objMessage
Set objMessage = Server.CreateObject("CDO.Message")
objMessageTo = "billy_fong@hotmail.com"
objMessageFrom = request.form("email")
objMessageSubject = "Message from the website"
objMessageBody = message
objMessageSend
set objMessage = nothing
response.redirect "confirm.asp?msg=" & Server.URLEncode("You have successfully sent your quote, thank you")
%>
The error was on the objMessageSend. What's wrong with that? Actually there was another form file which called to this asp file.
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:
I'm having a problem with passing variables inserting to my database. Here's what I'm doing. I have a page where the user selects a team member (this is fine) Once the team member is selected I have the variables on the form send and email to all supervisors and the member selected (this is fine also) BUT, I'm having problems inserting the emailed information to my access 2000 database after is email. Can someone guide me in the right direction.
View Replies View RelatedI'm trying to pass a piece of data i get from a query using a different form's passed values. This is how I get the data into the new form and how I try to pass it to the next asp page query.
<td valign=TOP width="168"><form action="HouseDetail.asp" method="post" name="MLS" id="MLS"><input name="MLS" type="hidden" value='<%=oRs("ML_Number")%>'><input name="Submit2" type="submit" value="Get Details"/></form></td>
The value='<%=oRS(ML_Number")%>' generates a real value like '2403943' - and the field I'm trying to use this value in the qry is expecting a number. But even passing the number without the single ' at both ends generates the same error message. Code:
I've Googling the web for the past two hours trying to find some code that will explain the following:
I have a Form with 250+ fields. I need to loop through all form fields and store the values into a VBScript 2-dimensional array (name of field, value of field). Once I have this 2-d array, I need to loop through it to create my SQL insert string, which will hook up to my MS Access 2000 .mdb file.
I totally understand the process, but I'm having a hard time with the syntax. Currently, I only have 60 fields, and I'm doing this type of thing manually. The thing is the form now needs to accomodate 250+ fields and there's no way I'm continuing to do this manually. Heck no!
Can someone please help wither with syntax or links to possible examples? I've been to devguru.com, asp101.com, aspfree.com, you name it, and I simply can't find an appropriate example.
Its been ages since ive used vbscript & asp, and im now needing something similar to what ive done in .Net for a legacy app. I need a method that will loop through all controls on a form and if their name has a certain prefix, then their values are added to a string that represents the form values entered.
Anyone point me to a similar example using only vbscript ?
I am trying to validate an asp form with VBScript, I am searching on the net but can't find the proper way to validate an option button to ensure one of the options was selected. Here is my code This one validated whether you select an option or not: Code:
View Replies View RelatedI have a form which submits to my ASP page, which uses the Persits ASPupload. When using the form, it works great. I want to run the submission from a program on a client instead of through IE. I am having trouble converting the form to VBS. Here is the form: Code:
View Replies View Relatedhow to access the form's field in the vbscript written in the same age without submitting the form.
Actually i want to access the ACCESS database to retrieve the records based on the value in the textbox catText.
request.form("catText") is just not working......
vbscript is the default language set up for the pages.
if i create a function in a vbscript then the SERVER objetc is not recognized at all!!!!!!!! How Come?
I've been asked to take data from a form and then send it to a vbscript. The client
has made a vbscript that performs a calculation (i haven't been told a great deal
about it yet) and now they wish to put it online, so that when a user enters
data into a form, it sends the data to the relevant fields in the vbscript.
I don't know a great deal about Visual Basic, so if anyone could explain how i might be able to go about this ..
It's a simple validation page and was working fine until i made some changes to the next page.
A regular form that calls a javascript function, but suddenly i javascript function does not execute anymore. i tried calling other functions but none of them works, but when i treid onSubmit("javascript:alert('some text')") it works fine.
I tried debugging it in dreamweaver and i get an regular expression missing error number 1005 on the last line of the javascript.. that is ....
I have a Function in VB Script that generates a signature. I assign the result to a variable and then need to do a hidden post to an ASP Page for further processing.
Basic functionality is I have a button upon pressing it -- It does the hidden post.
Code looks like this. Please assist with passing this stringToSign variable to the .asp page via hidden post. Code:
my code:
dim msconn
DIM mail, objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "admin@abc.com"
objMail.Subject = "This is a test"
objMail.To = "webmaster@xyz.com"
objMail.Body = "this is a test email from abc.com"
objMail.Send
Set objMail = nothing
This code works perfectly well from any machine apart from the domain controller. On the domain controller, i get the following access denied error message:
Microsoft VBScript runtime error '800a0046'
Permission denied
/Emailer.asp, line 310
I have given full permission to the drop folder in the mail root as guided in other sites. It's still not working.
Can anyone tell me where i'm going wrong? anything else i can try?
I am getting this error message with the following piece of code.
sqlSelect = "Select * from UserPermissions where UserID = " & UserID &
";"
set tbl = GetRecordset(sqlSelect, false)
while not tbl.eof
response.write ("<br>key: " & tbl("SectionID"))
Permissions.add tbl("SectionID"), 1
tbl.movenext
wend
The screen displays
key: 1
key: 2
I've been staring at this problem for two hours now.
I'm trying to write a piece of ASP that will allow me to display only one
element of a XML file. I am new to XML and wanted to find out what I am
doing wrong. I think it may be to do with the nodes ? When this is currently
run it comes up with the error "Overflow" ('800a0006').
Any pointers or solutions ? Code:
I am trying to split my search results into manageable pages, with 10 or 15 results per page. My question is- where do I place the pagesize element in this code? and what would it look like? Code:
View Replies View RelatedI use an array of elements and I want to know the position of a given element in my array
I know the filter function that allows to determine if the element i look for is in the array but this function doesn't allow me to know its position.
How can i find an asp file's TAG like input, button from another asp file...
For example i call a.asp from internet explorer and i want to list b.asp 's
elements.(input, button, etc...)
for i=1 to request.form.count
response.write request.form(i).name & " - " & request.form(i) & "<br>"
next
this throws Object doesn't support this property or method: 'name' is there anyway i can display the post data with its field name?
I'm creating an array from the querystring, then I want to find if something is in that array..
url = quiz.asp?done=6|3|4
done = Request.QueryString("done")
myArray = Split(done,"|")
For Each i In myArray
If myArray(i) = x Then
do something
End If
Next
I keep getting a "subscript out of range error"
I am creating a simple XML file via asp and want the XML to appear in the browser. Here is what I have tried: Code:
View Replies View Relatedis there a function i can use of some sort to remove a specific element in an array by its index number?
View Replies View RelatedI am creating a recordset paging script, however I am having a few issues. I need to remove a certain part of the querystring for it to work properly. i.e i need to remove
mydomain.asp?oParameter=124&oParameter2=87
I can't just do a Replace, because the value of the parameter will change for each page. Is ther an easy way to remove this from the full querystring?
Are there any div attributes that could force a div element to stay in the
background? I have a .vbs calendar class that opens a small calendar.
Unfortunately, sometimes it opens above a form element like a combo box and
the combo box shows on top of my calendar.
The combo in question happens to be within div tags because it hides/appears
depending on another form choice.
Any got any good links on forcing div elements to the background?