Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing ASP Generated Result Set to Javascript 1

Status
Not open for further replies.

jazzsax

Programmer
Oct 18, 2002
13
US
Hi,

I have created an ASP result set(RS) that includes a SQL query that generates a number of remaining spaces for registering for a seminar (total spaces minus spaces in which people have registered). This requires use of TotalSpaces - SUM(spaces) As RemainingSpaces in the query.
What I want to do is take the number of remaining spaces generated by this RS and compare it to the number the person has entered on the registration form. If the person enters a number that is more than the the number of remaining spaces, an alert message would pop up and tell them that they need to select fewer spaces. I was hoping to do this with Javascript form validation like all the other validations already on the form using the onChange event. Any suggestions?
 
<input onblur=&quot;if (this.value > <%= SUM %>) alert('sorry there are only <%= SUM %> places left. Please enter a smaller number blablabla.'); this.focus()&quot;>

I think that might work. Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top