if i enter the useriid and submit means
it has to check for the duplicate values and give alert message
that the userid already exists
function setValues(userid,username,proj,password,userrole,userlocation,userstatus)
{
var opt =document.frm_panel.reqcmd.value;
userid = userid.replace('<span style=background-color:#FFFF00>','');
userid = userid.replace('</span>','');
document.frm_panel.txt_user_id.value = userid;
document.frm_panel.txt_user_name.value = username;
document.frm_panel.txt_project.value = proj;
document.frm_panel.txt_password.value = password;
document.frm_panel.txt_user_role.value = userrole;
document.frm_panel.cmb_action.value = userlocation;
document.frm_panel.cmb_act.value = userstatus;
}
only for txt_user_id
Message was edited by:
sudhina
> if(document.frm_panel.userid1.value==document.fr
> m_panel.userid1.value){
> alert("Userid's must not be the same");
> }
can u tell me
how to give an alert message for delete
function setDelete(){
if(confirm("Are you sure you want to delete this file?")){
//do something
//of course delete something
}else{
//do nothing
}
}
then it would be:
function setDelete(){
if(confirm("Are you sure you want to delete this file?")){
//do something
//of course delete something
return true;
}else{
//do nothing
return false;
}
}
how to get the value from the search panel and
when i click radio button(ie in project_search.jsp")
it should return the value to txt_project
<input class="txt" type="text" name="txt_project" maxlength="30" readonly=yes> <input type="button" name="cmd_search" value="..." onClick="javascript:window.open('project_search.jsp?cmd=view&reqcmd=view&txt_project=' + document.frm_panel.txt_project.value, 'myWindow','toolbars=no,scrollbars=yes,menubar=no,height=400,width=500,left=275,top=50,readonly=yes' )">
but the error here is
its taking value to other text box and other as undefined.
how to get the value to the text box ("txt_project")
i gave like this
but it is not working
<script language="JavaScript">
function setDelete(){
if(confirm("Are you sure you want to delete this file?"))
{
return true;
}else{
return false;
}
}
</script>
<input type="submit" name="cmd" value=" OK " onSubmit = "return setDelete();">
Message was edited by:
sudhina
can be inserted into jsp as scriptlets
RegisterBean rb = (RegisterBean)form;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:odbc:SampleDB","","");
PreparedStatement pstmt = conn.prepareStatement("insert into logintable values(?,?,?,?,?,?,?,?,?,?,?)");
pstmt.setString(1,rb.getUsername());
pstmt.setString(2,rb.getPassword());
pstmt.setString(3,rb.getLastname());
pstmt.setString(4,rb.getFirstname());
pstmt.setString(5,rb.getMiddlename()!=null?rb.getMiddlename():" ");
pstmt.setString(6,rb.getAddress()!=null?rb.getAddress():" ");
pstmt.setString(7,rb.getPhone()!=null?rb.getPhone():" ");
pstmt.setString(8,rb.getEmail());
pstmt.setString(9,rb.getGender());
pstmt.setString(10,rb.getCivilstatus());
pstmt.setString(11,"3");
insert = pstmt.executeUpdate();
conn.commit();
conn.close();
} catch (Exception ex)
{
ex.printStackTrace();
}
hi jhe,
ca u tell me
y this error is coming
EXCEPTION WHILE WORKING WITH SQL "java.lang.IllegalArgumentException"
i declared like this
public Vector getResultsoftrack(String fileName,int upfileid,int downfileid)
see ,this problem can be solved very simply.
do as follow.
when u enter the value,before the cursor move to next field,we have to check the values.
For doing this,
code is:
<input type="text" name="userid" onBlur=checkUserId()>
see function:
checkUserId()
{
<%//here u get connection.
u write the query as follow
ResultSet rs=st.executeQuery("select * from tablename where userid='textfieldvalue';
so that u can test
if(rs.next())
//means alreday exists
else
//not exist.
}
I think u can understood cleary because i had given just a template
Cheers
Sudha.
9819542886.
hello sujatha,
if you use the codes that i gave you, then you must consider setting values for your database like if the data type is varchar2 then you will use preparedstatement.setString() , if number you can use preparedstatement.setInt(), preparedstatement.setFloat() or preparedstatement.setDouble() and others like preparedstatement.setDate();
hi jhe,
how to count a button click?
for example:
<td class="results_col" bgcolor="#F3F3E9"><input type="submit" name="myBox" value="Enable" onClick = "return confirm('Want to Enable?')"></td>
<%
String[] checkboxvalue = request.getParameterValues("myBox");
if(checkboxvalue != null)
{
fileName = rec.getfileName();
String downstatus = "";
batchb.modifydownstatusof(fileName,downstatus.toUpperCase().trim());
}
}
else
{ %>
<td class="results_col" bgcolor="#F3F3E9"> -- </td>
<% }
if i click the button
i should hava a count that how many times i clicked
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
<script language="javascript">
var x = 0;
function setButtonClick(){
x++;
alert("time clicked: "+x);
}
</script>
</head>
<body>
<form>
<input type="BUTTON" name="button" value="click me" onclick="setButtonClick()"/>
</form>
</body>
</html>
when you deploy the application server it should be placed on the server.. now if you are testing it on your jdeveloper on your local machine then you should map a drive on the server in order for you to save the files to the folder on the server.. and also change the path of the files from which it is save to you local machine to the path of your network drive
hi jhe,
my tomcat is starting up with this exception,
SEVERE: Catalina.start:
LifecycleException: Protocol handler start failed: java.net.BindException: Addr
ess already in use: JVM_Bind:8080
at org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:
1529)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
89)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:231
3)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
how to solve this,
thanks,
sujatha