If Condition
if Line = "" OR NOT IsNumeric(Line) Then
error_list.add"589344","desired line must be specified"
b_error = true
End If
how i can display an error msg saying that the user must only key in number but not character
if Line = "" OR NOT IsNumeric(Line) Then
error_list.add"589344","desired line must be specified"
b_error = true
End If
how i can display an error msg saying that the user must only key in number but not character
i am creating a kind of search using dropdown boxes to search the database. I have got two dropdown boxes one called location and one called cuisine i have sorted out some if statement.
so that it works if they select either one or the other and if they select any location or any cuisine but the problem comes when i need them to be able to select a cuisine in a particular location ie on bothe boxes.
i need it if both are selected at the same time then search the database via location and cuisine. can anybody help here is the code for the two files.
i have got one field in sql server 2000 database. field1 char 50 in one record, i m storing value -1 but it doesnt satisfy following condition
if (rs("field1")) = cstr("-1") Then
response.write ("true")
end if
i already checked its value by response.write and
print -1 only..
then y its above condition is false?
I WAS having problems. Solved it myself. I'll edit to show the working query for those who could use an example...
I'm having a multiple condition problem in my query statement. I know the what the result should be, but I have something wrong...
Here's the query:
set GetNADs = server.CreateObject("ADODB.Recordset")
set GetNADs.ActiveConnection = adoConnection ......
what s the correct syntax of setting a condition with a variable that is retrieved from database like in the example below:
dim x
x = 9
if rsTypes("one") = x then
response.write ("error")
I'm trying to make a very simple condition about some variable if it is empty do something but my problem is that it always cannot see it is empty
i mean i have a field in a table called title and this field is some times empty
so i need to type "empty" if it is
i tried this code ....
I want to check a another field and if its got info in it i want it to do the then bit, if the field thats checked has no info then its off to else
can some one give me a quick hand on what it should look like?
<%If Your_Condition_Here Then
Response.Write("<form ACTION=""=MM_editAction"" METHOD=""POST'""name=""form1"">")
Response.Write("<input type=""text"" name=""textfield"" value=""(tpwimportrs.Fields.Item(""comments"").Value)"">")
Response.Write("<input type=""hidden"" name=""MM_update"" value=""form1""><input type=""hidden"" name=""MM_recordId"" value=""tpwimportrs.Fields.Item(""ID"").Value "">")
Repsonse.Write("</form>")
Else
' Do Nothing
End If%>
I want to search through different strings and replace the ‘0’ with empty value. My problem is I want to search and replace the ‘0’ with empty values until there is a value other then ‘0’.
Examples
Ex 1: 000010000 - > my desired output -> 10000
Ex 2: 000170000 - > my desired output -> 170000
Ex 3: 004001000 - > my desired output -> 4001000
I've got the following code that sets a session object.
set obj = server.createobject("Scripting.Dictionary")
set session("testobj") = obj
If I want to remove the session object, do each of the following does
the same job? Which one is the best?
1 --> set session("testobj") = null
2 --> set session("testobj") = nothing
3 --> Session.Contents.Remove("testobj")
If I want to check if the session object is not exist, which is the
best option?
1 --> if (session("testobj") = null) then ...
2 --> if (session("testobj") = nothing) then ...
3 --> if (isobject(session("testobj"))) then ...
I have set up a table of Ticket Types. Most of these only have a ticket number but one type also has a reference number.
I am trying to display the info in a table and show the ticket number for every type and only show the Ref number when it is applicable.
I'm guessing its a FOR ELSE statement but I can't get it working. Code:
I want to change the font colour to red if a recordset value is 'high' but i dont know where to put the font tags, Heres what i got so far:
<td width="13%" align="center"><% if rs("priority") = "High" then response.write rs("priority")
else response.write rs("priority") %></td>
But where would i put the font tag and the colour, so it coloured the priorities marked as high red?
I am trying to update and append to an existing XML file. However I seem to be stuck. I am using ASP as my scripting language.
The form fields has the same value as the KEY attribute so all i have to do is loop through the submiting form for its fields and use the name to update the XML via the keys... Code: