Avatar of sammySeltzer
sammySeltzer
Flag for United States of America

asked on 

"Show New page if ID" is blank isn't working

Greetings good helpers.

I have what appears to be simple "if else end if" conditional but it isn't working.

My code says:

subID = request("subID")
mainID = request("mainID")

Then the "If" conditional:

If subID = "" OR if mainID = "" then
  PageTitle = "Add New record"
Else
strSQL = "Select * from mytable where subID = " & subID & " and mainID = " & mainID & " "
set rs=conn.Execute(strSQL)
PageTitle = "Update Record"
end If

Then on my form, I have something like:

<form name="myform" method="post">
         <input type=hidden name=ChildId value="<%=ChildId%>">
        <input type=hidden name=Chsid value="<%=currentChsid%>">
    <table border=1 cellspacing=0 cellpadding=0 width="100%" valign=top height="370px" borderColorDark="#5C604D" borderColorLight="#5C604D">
      <tr>
        <td>
            <TABLE cellSpacing=1 cellPadding=1 width=100% border=0>
              <TR>
                    <TD width=155 style="color:#5C604D;font-weight:bold"><%=PageTile%></TD>
                    <TD Colspan=5 align=right valign=top>&nbsp;</TD>
                </TR>
                </TABLE>

and the rest of the code.

Problem is that always shows "Add new Record" even when subId and mainID are not blank.

Any help is definitely appreciated.
Web Languages and StandardsASP

Avatar of undefined
Last Comment
Wayne Barron

8/22/2022 - Mon