Advertisement

07.31.2003 at 12:59PM PDT, ID: 20696123
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

javascript validation

Asked by Davehalo1 in Web Languages/Standards

Tags: , ,

Can anybody point out why this javascript validation is not working.
I need to validate the page from accepting negative numbers:-

0 is ok

-1 to - whatever should give an alert.

Thanks
Dave.

<%@LANGUAGE="VBSCRIPT"%>
<%option explicit%>
<html>
<head>
<title></title>
<SCRIPT language="JavaScript">
<!--Hide JS Validation Code-->
var justValidating = true
function validateForm (form)
{
if (!validateQty(form.Qty.value)) //Quantity validate
{
form.Qty.focus()
return false
}
return true
}

//<!--Negative Quantity-->

function validateQty(Qty) //Verify Negative Quantity script
{
if (isBlank(Qty))
{
alert("Please insert the quantity you require.")
return false
}
if (document.QuantityChange.Qty.value <0)
{
alert("Your have entered a negative number.")
return false
}
else
return true
}
// end JS hide -->
</script>

</head>
<!--Cart.asp page-->
<link href="stylesheet2.css" rel="stylesheet" type="text/css">
<link href="stylesheet1.css" rel="stylesheet" type="text/css">
<link href="stylesheet3.css" rel="stylesheet" type="text/css">
<body>
<!--#include file="inc/header.asp"-->
<!--#include file= "dbconn.asp"-->
<!--#include file= "adovbs.inc" -->
<!--Cart.asp page, holds and diplays details of quantity, items, and prices of

purchases, with delete
and quantity modification proceedures.-->
 <%
 Response.write"<table width='779'><tr> <td width='779' height='246' align='center'

valign='top'>"
   Dim myRS, mySQL, subtotal, total, artsearch
   
       Set myRS = Server.CreateObject("ADODB.Recordset")
         mySQL ="SELECT tbl_cartitems.CartItemID, tbl_cartitems.CartID,

tbl_cartitems.artistname, tbl_cartitems.cdtitle, tbl_cartitems.cdcost,

tbl_cartitems.qty, tbl_Carts.Cust_ID FROM tbl_Carts INNER JOIN tbl_cartitems ON

tbl_Carts.CartID = tbl_cartitems.CartID WHERE (((tbl_cartitems.CartID)=" & CartID &

"));"
myRS.Open mySQL, myConn
If myRS.EOF Then
'Response redirect if cart is empty.
  Response.Redirect "Empty.asp?cartid=" & Cartid & " "
 else
 'Cart table header layout.
Response.write"<table width='82%' border='1' align='center' cellpadding='2'

cellspacing='0' bordercolor='#FFFFFF' valign='top'>"&_
"<tr bordercolor='#FFFFFF'>"&_
            "<td width='79' height='25' valign='top'><span

class='innertablewhite'>Quantity:</span></td>"&_
            "<td width='72' valign='top'><span

class='innertablewhite'>Remove:</span></td>"&_
            "<td width='260' valign='top'><span

class='innertablewhite'>Item:</span></td>"&_
            "<td width='15%'><span class='innertablewhite'>Price:</span></td>"&_
            "<td width='17%'><span class='innertablewhite'>SubTotal:</span></td></tr>"
While Not myRS.EOF
'Cart table details layout.
             Response.write"<tr bordercolor='#FFFFFF'>"&_
            "<td align='center' valign='top'><form action='qtymod.asp'

method='get'name='QuantityChange' id='QuantityChange'onsubmit='return

validateForm(this)'>" &_
      "<input type='hidden' name='CartItemID' value='" &_
      myRS("CartItemID") & "'>" &_
      "<input type='hidden' name='CartID' value='" & CartID & "'>" &_
      "<input type='text' name='Qty' id='Qty'size='2' value='" &_
      myRS("Qty") & "'><input type='submit' value='Chg.'>" &_
      "</form></td>"&_
            "<td align='center'><form action='delete.asp?CartID=" &_
      CartID & "&CartItemID=" & myRS("CartItemID")&"' method='post'><input

type='submit' name='Submit' value='Delete.'><Input type ='hidden' name='CartID'

value='"&CartID&"'> </form></td>"&_
            "<td valign='top'><span class='record2'>"

&myRS("artistname")&"<br>"&myRS("cdtitle")&"</span></td>"&_
            "<td><span class='record2'>£"&FormatNumber(myRS("cdcost"))&"</span></td>"
Subtotal=myRS("cdcost") * myRS("Qty")
            response.write"<td align='center'><span

class='record2'>£"&FormatNumber(Subtotal)&"</span></td></tr>"
Total = Total + Subtotal
                    myRS.MoveNext
Wend
End If 'End of recordset loop.      
'Displays items in cart.
Artsearch =request.querystring ("Artistname")
Response.write"<tr bordercolor='#FFFFFF'>"&_
            "<td height='25' colspan='4' align='right' class='innertable'>Total

Cost:</td>"&_
            "<td align='center'><span

class='record2'>£"&FormatNumber(Total)&"</span></td></tr>"&_
"<tr><td colspan='5' align='center' valign='middle'><form action='store.asp'

method='get'>"&_
"<Input type ='hidden' name='CartID' value='"&CartID&"'><input type='submit'

name='Submit' value='Back To Store.'></form> "&_
"<form action='artsearch.asp' method='get'>"&_
"<Input type ='hidden' name='CartID' value='"&CartID&"'>"&_
"<Input type ='hidden' name='Artsearch' value='"&artsearch&"'>"&_
"<input type='submit' name='Submit' value='Back To Search Results.'></form>"&_
"<form action='order.asp?CartID=" & CartID & "' method='post'>"&_
"<input type='hidden' name='Total' value='" & FormatNumber(Total) & "'><input

type='submit' name='Submit' value='Checkout.'></form>"&_
"</td></tr>"&_
"</table>"&_
"</td>"&_
"</tr>"&_
"</table>"
%>
<!--#include file="inc/footer.asp"-->
</body>
</html>
Start Free Trial
[+][-]07.31.2003 at 01:41PM PDT, ID: 9043956

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.31.2003 at 01:59PM PDT, ID: 9044120

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.31.2003 at 02:42PM PDT, ID: 9044386

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.31.2003 at 03:50PM PDT, ID: 9044770

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 06:18AM PDT, ID: 9054006

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 07:24AM PDT, ID: 9054171

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 08:05AM PDT, ID: 9054288

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 08:13AM PDT, ID: 9054311

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 08:48AM PDT, ID: 9054438

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 08:51AM PDT, ID: 9054444

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 08:54AM PDT, ID: 9054452

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 09:14AM PDT, ID: 9054504

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.02.2003 at 09:24AM PDT, ID: 9054531

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.04.2003 at 11:33AM PDT, ID: 9073050

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.04.2003 at 02:06PM PDT, ID: 9074171

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.04.2003 at 03:57PM PDT, ID: 9075004

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.04.2003 at 04:29PM PDT, ID: 9075143

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.04.2003 at 04:30PM PDT, ID: 9075148

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.04.2003 at 04:55PM PDT, ID: 9075224

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Web Languages/Standards
Tags: javascript, validation, number
Sign Up Now!
Solution Provided By: abuimad
Participating Experts: 3
Solution Grade: A
 
 
[+][-]08.04.2003 at 05:30PM PDT, ID: 9075339

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2003 at 03:48AM PDT, ID: 9079489

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42