Click here to Skip to main content
16,011,905 members
Home / Discussions / Web Development
   

Web Development

 
QuestionWhat is the difference between JDK and JRE? Pin
George Ma19-Sep-02 4:01
George Ma19-Sep-02 4:01 
AnswerRe: What is the difference between JDK and JRE? Pin
David Salter19-Sep-02 11:22
David Salter19-Sep-02 11:22 
GeneralRe: What is the difference between JDK and JRE? Pin
George Ma19-Sep-02 17:18
George Ma19-Sep-02 17:18 
AnswerRe: What is the difference between JDK and JRE? Pin
HoseaH19-Sep-02 20:51
HoseaH19-Sep-02 20:51 
GeneralRe: What is the difference between JDK and JRE? Pin
George Ma20-Sep-02 2:34
George Ma20-Sep-02 2:34 
GeneralA good book on Client/Server developpment Pin
Olivier REIX19-Sep-02 2:26
Olivier REIX19-Sep-02 2:26 
Generalcalling a subprocedure Pin
mcm19-Sep-02 2:04
mcm19-Sep-02 2:04 
GeneralRe: calling a subprocedure Pin
Paul Watson19-Sep-02 3:30
sitebuilderPaul Watson19-Sep-02 3:30 
mcm wrote:
what am i doing wrong?
thank you!


You are confusing client side with server side.

When you use the <% and %> block declarations you are specifying that all code within that block is processed on the server and NOT sent to the client as is.

So in fact when you have the onclick="Validate()"> code firing off there is not function Validate to call because it was "left" behind on the server. Also you cannot get server side code to show an alert box on the client side directly.

So, this is how you do what you want to do.
<script language="javascript>
function Validate()
{
//ERROR CATCHING
//question 2
if (document.People == "" || AND document.Specify == "")
{
    alert("Please enter value for Q2");
    return false;
}else{ return true;}
}
</script>

<input TYPE=RESET name="btnAdd" value="Reset" onclick="return confirm('Are you sure you wish to reset?');"><input TYPE="submit" name="btnAdd" value="Submit" onclick = "Validate()">



So basically you are mixing up your client side code (JavaScript) and your server side code (ASP.)

Paul Watson
Bluegrass
Cape Town, South Africa

GeneralIHTMLAnchorElement --- Help please Pin
Gegzy19-Sep-02 0:55
Gegzy19-Sep-02 0:55 
GeneralRe: IHTMLAnchorElement --- Help please Pin
Gegzy19-Sep-02 11:06
Gegzy19-Sep-02 11:06 
GeneralRe: IHTMLAnchorElement --- Help please Pin
Stephane Rodriguez.19-Sep-02 19:35
Stephane Rodriguez.19-Sep-02 19:35 
GeneralSQL login problem from ASPNET Pin
leppie18-Sep-02 23:34
leppie18-Sep-02 23:34 
GeneralSolved Pin
leppie19-Sep-02 1:01
leppie19-Sep-02 1:01 
GeneralSMTP in Windows2000 Adv Server Pin
hien_ng8018-Sep-02 23:24
hien_ng8018-Sep-02 23:24 
QuestionHost ASP in my app? Pin
CherezZaboro18-Sep-02 9:20
CherezZaboro18-Sep-02 9:20 
Generalerror handling and message boxes Pin
mcm18-Sep-02 5:59
mcm18-Sep-02 5:59 
GeneralRe: error handling and message boxes Pin
Megan Forbes18-Sep-02 8:27
Megan Forbes18-Sep-02 8:27 
Generalretaining state for checkboxes and radio buttons Pin
mcm17-Sep-02 23:03
mcm17-Sep-02 23:03 
GeneralRe: retaining state for checkboxes and radio buttons Pin
benjymous18-Sep-02 5:11
benjymous18-Sep-02 5:11 
Generalreset button Pin
mcm17-Sep-02 22:46
mcm17-Sep-02 22:46 
GeneralRe: reset button Pin
raajsekhar20-Sep-02 1:02
raajsekhar20-Sep-02 1:02 
QuestionIs There A Decent ASP Book? Pin
Roger Wright17-Sep-02 20:06
professionalRoger Wright17-Sep-02 20:06 
AnswerRe: Is There A Decent ASP Book? Pin
Paul Watson17-Sep-02 21:25
sitebuilderPaul Watson17-Sep-02 21:25 
GeneralRe: Is There A Decent ASP Book? Pin
Roger Wright18-Sep-02 4:13
professionalRoger Wright18-Sep-02 4:13 
GeneralRe: Is There A Decent ASP Book? Pin
Paul Watson18-Sep-02 4:32
sitebuilderPaul Watson18-Sep-02 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.