Form Element
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
View Replies
ADVERTISEMENT
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?
View Replies
View Related
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 Related
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
%>
View Replies
View Related
i 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 Related
how 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 Related
I 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.
View Replies
View Related
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.
View Replies
View Related
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:
View Replies
View Related
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 Related
I 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.
View Replies
View Related
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...)
View Replies
View Related
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?
View Replies
View Related
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"
View Replies
View Related
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 Related
is there a function i can use of some sort to remove a specific element in an array by its index number?
View Replies
View Related
I 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?
View Replies
View Related
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?
View Replies
View Related
How to disable a select element via vbscript from another element in the same form. I want to disable a text area element named xptoTextArea if and only if a certain option value is selected.
If this option is selected then disable this text area element.
View Replies
View Related
I have created the following code to create the recordset rsToBeApprovedLocalItemID. Unfortunately, the for next loop works properly only on the first cycle. The response.write(arrToBeApprovedCatSub(0)&arrToBeApprovedCatSub(1)&"<br>")works for each loop but the SQL statement sqlToBeApprovedLocalItemID returns a populated recordset only on the first loop.
On subsequent loops it is empty even though the arrToBeApprovedCatSub(0) and arrToBeApprovedCatSub(1) are alive and well. What's going on? This is truly weird behaviour. I have not come across something this funky before. Code:
View Replies
View Related
I´m having a problem using ASP Upload with an insert form..
If I use ENCTYPE="multipart/form-data" the all the parametres i might get with request.form don´t appear.. but i can upload the files.. Besides if I take away the ENCTYPE tag, i can´t upload but the INSERT INTO form works propertly
View Replies
View Related
my form contains two text fields(name, address) and two file field control where user can insert image(photo1 and photo2), i want to insert this data in to ms access when the user submits the form?
this is my code for insert text fields to access data base.but i have no idea about the code for image fields. In my access data base i set photo1 and photo2 as herf (binary data). Code:
View Replies
View Related
I have a form that is dynamically generated since it is populated with values retrieved from a database. The form can of course also be submitted, which is where I run into some problems.
Since I never know in advance what the length of the form (or for that matter what the different elements' names and values) will be I don't know how to write the code in "receive.asp" to retrieve all values from the form correctly without excess use of "request.....".
I shouldn't have to write requests for every single potential element name that is stored in the DB. Please note that the form can sometimes also contain radio buttons and check boxes, even though they are not present in this short example Code:
View Replies
View Related
I have a form as follows:
<form action="dropboxsubmit.asp" method="post" enctype="multipart/form-data">
<input type="file" name="FILE1" size="30">
<input type="text" name="def" value="0" size="10">
etc.....
and can't get my asp to recognize data in other form input boxes using Request.Form
Any thoughts?
View Replies
View Related
In my prototype asp page (with no javascript and no password validation, I have a registration form with the following action:
<form name="form" method="post" action="RegDetails.asp">
This works fine, the form details are collected by RegDetails.asp
I am attempting to include javascript server side validation for the pasword, which obviously requires password and password2 fields (to be verified). I have used the script available at:
http://javascript.internet.com/forms/val-pass.html
It works fine in a new blank page with the form action:
<form name=myForm onSubmit="return validatePwd()">
The final stage in this javascript demo form displays an alert box:
else {
alert('Nice job.');
return true;
When I change the first line of my original form to:
<form name=myForm onSubmit="return validatePwd()">
how do I get my original action of - action="RegDetails.asp" instead of this alert box?
View Replies
View Related
I have a form on an ASP page that has 5 text boxes, for data entry. I am trying to get data from the text box, and pass it to a hidden text box on the form.
The hidden text box is called "MyDateTime" (a SQL date and time value). I am attempting to concatenate data from two other textboxes (one for date and one for time) to give a string like : "8/8/2004 8:00 AM" I am trying to use the following: Code:
View Replies
View Related
I have some ASP server-side code that works perfectly when the client is running on Windows (IE, Netscape, Firefox, etc.) but doesn't work at all when the client is running on Macintosh (IE, Omniweb, Safari, etc.) This is the client-side Javascript code:
View Replies
View Related
Im having problems with my form, separately both forms work perfectly, but having problem sending the email once submitted, however the upload fuction is working fine. The message im getting is,
Request object error 'ASP 0207 : 80004005'
Cannot use Request.Form
/forminfo.asp, line 42
Cannot use Request.Form collection after calling BinaryRead.
Heres the script Code:
View Replies
View Related
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.
View Replies
View Related
<%@Language=VBScript %>
<%option explicit%>
<%
MESSAGE = (Request.Form("type"))
MESSAGE=MESSAGE & vbcrlf & "Name" & (Request.Form("name"))
MESSAGE=MESSAGE & vbcrlf & (Request.Form("address"))
MESSAGE=MESSAGE & vbcrlf & (Request.Form("handphone"))
MESSAGE=MESSAGE & vbcrlf & (Request.Form("phonenumber"))
MESSAGE=MESSAGE & vbcrlf & vbcrlf & (Request.Form("comments"))
MESSAGE=MESSAGE & vbcrlf & vbcrlf
MESSAGE=MESSAGE & "____________________________________________"
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From =Request.Form(email)
objMail.To = "icepricessa@hotmail.com"
objMail.Subject = "Business/Career Enquiries"
objMail.Body = ""&MESSAGE&""
objMail.Send
Set objMail = Nothing
%>
but somehow i'm not able to send the mail....
View Replies
View Related
I have a series a forms that submit data to different tables in a database. As it stands, when a user completes FORM 1 and clicks the SUBMIT button, the FORM 1 data is submitted (action = form2.asp, method = post) to ASP code at the top of FORM 2 (request.form("form1 field name") etc...), and submitted to the database with SQL code, also at the top of FORM 2(INSERT into...). Hence the submit button on FORM 1 directs the user to FORM 2, and submits the data which is exaclty what I wanted. However, I now need the users to submit multiple sets of data with FORM 1, and direct them to FORM 2 once they have finished using FORM 1. Most importantly, I need to pass a few parameters from FORM 1 to FORM 2, and have these parameters submitted to the database.
My main problem is getting a fresh form1 after submiting the same form1, in preparation for anoter set of data using the same form. Basically, the database has 'one to many' relationship tables. Form1 and form2 are both populating the 'many' tables, so that each form needs to be filled-in several times while retaining the key field of the 'one' table. At the moment submiting form1 takes me to form2. Is is possible to submit the data to the database, get form1 back again to submit more data, as many times as required, then click another button to load form2 when the user is finished with form1?
Can anyone please give me some pointers? or at least explain the concept of what I need to do. I am a novice and it's taking me a while to get to this stage. Any help will be greatly appreciated.
Is it possible to post FORM1 to itself and insert the data (i.e. place the request.form at the top of FORM 1) If so, how do I direct users to FORM 2 while retaining my parameters?
View Replies
View Related
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?
View Replies
View Related
I have a simple form to accept two form fields and display the values
entered on pressing the submit button. The following is the form I have
created to accept the two entries and display the form fields on
pressing the submit form. It does not work can somebody please correct
the code or provide a simple equivalent code where I can have the form
and the validation and usage of the form values in the same ASP page.
Code:
View Replies
View Related