Avatar of Aleks
Aleks
Flag for United States of America asked on

how to redirect based on 2 conditions

Using ASP/Javascript

I need to

redirect to  'Usermaxoutdisbled.asp'

if the following value of a recordset is zero:

UserLogin.Fields.Item("Enable").Value  = 0

and the recordset 'MaxUsers'  is empty

What would the syntax be ?

Thanks ...
ASPJavaScript

Avatar of undefined
Last Comment
Wayne Barron

8/22/2022 - Mon
Tomarse111

Assuming your MaxUsers is coming from an ASP recordset, I would us a hidden form element populated with the recordset amount. Then you can check against that. Something along the lines of.
<input type="hidden" id="rs" value="<%MaxUsers.recordcount%>">
 
 
......
 
 
<script type="text/javascript">
 if((UserLogin.Fields.Item("Enable").Value==0)&&(document.geteElementById('rs').value==0))){
window.location='Usermaxoutdisbled.asp';
}
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Tomarse111

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Wayne Barron

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck