melvinoyh
05-26-2006, 04:25 AM
<script language="javascript">
function disable(){
document.getElementById("submit").disabled=true;
}
</script>
<html>
<body>
<%
String flag="view";
if(flag.equals("view"){%>
<script type="text/javascript">
disable();
</script><%
}
%>
<input type="submit" onClick="onSubmit();" id="submit" value="Submit" style="width:85px"/>
</body>
</html>
wanna ask, for example the calling the function code is correct or not?
before call the function, first check the flag is it 'view' or not, if 'view' then only perform the function.
function disable(){
document.getElementById("submit").disabled=true;
}
</script>
<html>
<body>
<%
String flag="view";
if(flag.equals("view"){%>
<script type="text/javascript">
disable();
</script><%
}
%>
<input type="submit" onClick="onSubmit();" id="submit" value="Submit" style="width:85px"/>
</body>
</html>
wanna ask, for example the calling the function code is correct or not?
before call the function, first check the flag is it 'view' or not, if 'view' then only perform the function.