[SOLVED] editUser() function not called, Help Please

This is a discussion on "[SOLVED] editUser() function not called, Help Please" within the JavaScript Forum section. This forum, and the thread "[SOLVED] editUser() function not called, Help Please are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Nov 14th, 2007, 11:50
New Member
Join Date: Nov 2007
Location: Hyderabad
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] editUser() function not called, Help Please

Hi friends,

Can somebody tell me why the editUser(type) function is not called?

In the 2nd Form, the deleteUser(id) is being called, but not editUser().

HTML: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
    <!--
       function editUser(type){
           alert("inside the loadForEdit");
           
        }    
        
        function deleteUser(id){
          var result = confirm("Do You want to Delete");
          if(result){
              alert(id);
              document.forms.frmEditDelete.action = "<%=basePath%>deleteuser.do";
                document.forms.frmEditDelete.submit();
          }          
        }        
        
        function addUser(){ 
            var user =    document.forms.frmAdd.usertype.value;
            if(user == ""){
                alert("Please Enter a User Type First");    
            }else{
                document.frmAdd.submit();
            }
            
        }
    //--> 
</script>
<link href="needcar.css" rel="stylesheet" type="text/css">
</head>
<body>
      <form name="frmAdd" method="post" action="<%=basePath%>adduser.do">
        <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" class="border1">
          <tr height="50%"> 
            <td width="31%" class="txt" rowspan="2"><strong>User Type</strong>&nbsp;&nbsp;&nbsp;&nbsp; 
            </td>
            <td width="69%"><input id="iptUser" name="usertype" type="text" class="input" id="user2" size="30"></td>
          </tr>
          <tr>               
            <td colspan="2" valign="middle"> <br> <input name="btnAdd" type="button" class="button" value="&nbsp;&nbsp;&nbsp;Add&nbsp;&nbsp;&nbsp;" width="50" onclick="addUser();"> &nbsp;&nbsp; 
              <input name="btnSave" type="button" class="button" value="&nbsp;&nbsp;Save&nbsp;&nbsp;" disabled="disabled" width="50"> 
              &nbsp;&nbsp; <input name="btnReset" type="reset" class="button" value="Cancel" width="70">  &nbsp; </td>
          </tr>      
        </table>  </form> <p>  


        <form name="frmEditDelete" method="post"> 
        <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" class="border2">
          <tr> 
            <td height="30" colspan="3" class="txt" bgcolor="#666666"><font color="#FFFFFF" size="2" face="verdana"><strong> &nbsp;&nbsp;User Types Details</strong></font></td>
          </tr>
          
          <%
              String type;
              int id;
              while(rs.next()){
               id = rs.getInt(1);
               type = rs.getString(2);              
          %>          
              <tr>
              
              <td class='txt' height="25" valign="middle">
                  <strong><%=type%></strong>
              </td>
              
              <td width='26%' height='25' valign="middle">
                  <center>                                  
                      <input type="hidden" name="id" value="<%=id%>">
                      <input type="hidden" name="type" value="<%=type%>">
                      <input name='btnEdit' type='button' class='button' value='&nbsp;&nbsp;&nbsp;Edit&nbsp;&nbsp;&nbsp;' onclick='editUser(<%=type%>);'>                  
                  </center>
              </td>              
              <td width='34%' height='25' valign="middle">
                  <center>                  
                      <input name='btnDelete' type='button' class='button' value='Delete' onclick='deleteUser(<%=id%>);'>
                  </center>
              </td>
          </tr>
              
          <%    
           }    
          }catch(Exception ex){
            ex.printStackTrace();
          }          
          %>
        
        </table>
        </form>
        <br>      
      <br>
    </td>
    <td width="189" align="center" valign="middle" bgcolor="#333333">
    </td>
  </tr>             
</table>
</body>
</html>


Can somebody know about it? Please Help me...

thanks in advance for your help....


Ashish

Last edited by c010depunkk; Nov 14th, 2007 at 13:04. Reason: please use [HTML] tags when displaying HTML
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 16th, 2007, 05:55
Up'n'Coming Member
Join Date: Jun 2007
Location: Germany
Age: 23
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Re: editUser() function not called, Help Please

What the... Please tell me what kind of script that is.. never seen before. ^_-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 16th, 2007, 06:04
New Member
Join Date: Nov 2007
Location: Hyderabad
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: editUser() function not called, Help Please

I solved this. I need to pass the value in '<%=type%>' instead of <%=type%>

This code is of JSP.

thanks a lot
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with echo function on PHP [SOLVED] sing2trees PHP Forum 15 Jun 7th, 2008 19:14
[SOLVED] Is this a suitable 'search CSV' function? Aso PHP Forum 8 Dec 18th, 2007 15:19
[SOLVED] Does using PHP include() function affect my SEO ? RohanShenoy Search Engine Optimization (SEO) 3 Nov 22nd, 2007 18:13
[SOLVED] why onclick is not called - Help Please ashishmishra16 JavaScript Forum 2 Nov 16th, 2007 06:02
[SOLVED] Calc function Pugger JavaScript Forum 15 Nov 6th, 2007 20:08


All times are GMT. The time now is 16:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42