I want to create two dynamically linked list boxes.Instead of hardcoding in the arrays to accomplish this, I want their contents to come from a Recordset.
What I need to know is how to turn the Recordset into a local array and then how to create the select lists from the array contents.
I put the same code into a simple test document to verify, except for mine has Response.Write. All my numbers came out negative. If I reverse their positions, I get positive numbers. Is the example above wrong or is there something going on with my PC?
I am trying to trun some numbers into currency using a calculated valuein a query.Although the result formats the results as currency, it sorts as a string would. Here is my statement:
Im having a little trouble with a simple form request My form has a field for people to add the filename that they saved their document in. Once that is entered my submit page takes the filename and adds the hyperlink html and the mapped path to that directory That way even "less intelligent" people can add hyperlinks to the database The problem Im having is that i cant find the code to make it to where if the value of a radio button is true then not to request the hyperlink field.
Don't get me wrong I am very much a newb at this so I assume its really easy or there is something Im not grasping here. So I guess the question is, Is there a simple line of code to relate a radio button to another form field?
IN an ASP page I am using the following number formatting for currency, Code:
<%=FormatCurrency(RS("increvhigh"), 2, -1, -1)%>
When I put in my data as a negative number, it is saved to the Access database with parenthesis around the negative number. When I go to the ASP page to display records as line items, the record with the negative value will not display.
Static.htm Contains a form with two text boxes, called text_1 and text_2 and some other info that is irrelevant for my question.
Dynamic.asp Need some code to check that the text boxes only contain values greater than 0 and only numbers. Thus if any of the textboxes for example contain -3 or the letter m I want to cancel the form submission and display some kind of error message.
I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?
in master batch table i have various master batch like 200701-0001 200701-0002 200701-0003
Now each master batch can have multiple final mixed batch like
200701-0001-01 200701-0001-02 200701-0001-03
and this record is inserted in to fmix table.
so i have a form in which i have a dropdown menu in which all the master batch is listed, i select 200701-0001 and that value is passed to next page where i will enter other fields data and insertion to my fmix_no will be done automatic like 200701-0001-01, 200701-0001-02 and so on,
how to achieve this
so in short each master batch will have more than one final mixed batch.
pls help, also if u have any online contact in yahoo or msn pls send me, i am so confused and badly struck deadline is just couple of hours away. my yahoo id is(E-Mail address blocked: See forum rules) you can PM me i am online right now.
I want To handel the error messages by myself in one part in my script. I know that in VB I can Use the statment - On error resume next And I also know that I can retrive the Error Number In VB with Err.Number.
How can I handel the errors by myself in ASP? I heard about the ASPErr Object, Is it the same thing like the err object in VB?
I have an error statement in place which i would like to catch when a problem aoccures and assign a value to Compensation. Code:
If Err.number<>0 then
If iCount Mod 2 = 1 Then objRS.Move ((iCount + 1)*0.9)-1 Compensation = Int(objRS(0)) Else objRS.Move (iCount*0.9)-1 Compensation = objRS(0) objRS.MoveNext Compensation = (Compensation + objRS(0))/2 End If Else Compensation = 0 End If
at the moment,Compensation seems to always have the value of 0 even when an error is not evident. Have i got this the wrong way around?
I am using the code below to count the number of records and divide it by the sum of the records to get the average number. I get the error : Type mismatch: 'ubound' . I know I'm missing something obvious as my experience with arrays have rendered below.
<% PriceArray = Recordset1("TotalBidPrice") %>
<% for x = 0 to ubound(PriceArray,2) CountArray = CountArray + PriceArray(0,x) next
I have a form on my site, in the form there is a field called ticketid, I want this field to be prepopulated everytime the user opens the form, Also would like to have it start with 1000 so if the it gets open second time its 1001, third time 1002 and so on. Code:
Microsoft OLE DB Provider for SQL Server (0x80040E2F) Cannot insert the value NULL into column 'ContactID', table 'ka0506a.ka0506a.contacts'; column does not allow nulls. INSERT fails. /submitcontact.asp, line 15
What happened is i used to used MS Access and ContactID is an Autonmuber field, and now my connection is set to MS SQL so it's giving me this error, what's causing this error to happen and how can i change it ?
I have a repeater that pulls back informtion from a MySQL database. I was wondering how could I put a counter that increments as each row is returned and displays it in the repeater. For example where it says Day:, I want to make that Day: 1, Day: 2 etc as each row is returned.
The Day: 1++ is just a demonstration of what i want incremented.
I've created a freight calculator that needs to know how many pallets I'm shipping. I'm using 1 pallet for 750lbs and an extra pallet for anything more than that.
If materialWeight <= 750 Then numPallets = 1 Else numPallets = Round(materialWeight / 750) End If
Now, let's say the materialWeight/750 ends up being 3.2. This is returning 3, but I need it to return 4 since we need an extra pallet.
How can I make it Round up to the next whole number? If it turned out to be an exact number without a decimal then it should stay where it is, but if it's over x.0 at all it should go up to the next whole number.
Is there a command in asp to truncate a decimal? Currently I've got a number that's coming out with up to about 12 decimal places based on input fom the user and I'd like to force it to just display up to two decimal places. Is that possible?
When we are using ENCTYPE="multipart/form-data" for file uploading, we can use Request.TotalBytes to get the total number of bytes sent by the user in http. Is it possible to get the bytes of a specific field from that form
Does anybody know how I can get the week number. The week number we are currently on is 28 and I need to be able to reitrieve this number so that i can manipulate for loops to advance that number to 33 and 38.
I have an ASP variable which is a certain number. I want to create a Select tag in a form, which will be populated up to this number. So, for example, if my number was 7, you would have a list of numbers between 0 and 7 to select.I'm not sure how to do loops, but I had an idea that the code would look something like this: Code:
<select name="select2" id="select">
<% for i=0 to i=varNumber Response.Write ("<option value='"& i &"'>"& i &"</option>") rsBooking.MoveNext %>
I want to trim a number and display the integer and decimals separately, as such I'm trying to convert it to a string so I can truncate it. No matter what combination of int or CStr I try, VBScript displays long numbers such as:
345332523545325425235255453.6789555
in its exponentiated form:
3.45332523545325E+26
How can I stop this?Alternatively is there a function that will separate the two for me?