Results 1 to 8 of 8

Thread: JSP: Object Doesn't support this property or method

  1. #1
    Join Date
    Apr 2007
    Location
    KL
    Posts
    20
    Rep Power
    0

    JSP: Object Doesn't support this property or method

    hi.. sy tak sure dah ada post pasal ni ke tak..Anyway, ni juz simple error yg sy dh tak tau nk solve camne dah..

    sy ada JSP page:
    <html>
    <form name="Form1" method="post">
    <table>
    <tr><td><input type="text" name="addgrpCde" id="addgrpCde" size=10 maxlength=4 value="<%=ms_grpcde%>" onblur="viewrcd_valid()">
    </td></tr></table></form></html>

    ..in javascript
    function viewrcd_valid()">
    {
    alert ("here");
    document.Form1.action = "IN_ingrpfScript.jsp";
    document.Form1.submit();
    }



    Result slps Run:
    -> keluar alert "here"
    -> dpt error ni : Object Doesn't support this property or method


    tujuan sy slps user enter grpCde, akan go to javascript, do some validation checking then submit the form&value to IN_ingrpfScript.jsp.
    2) even kalau sy letak <input type"button" onclick="viewrcd_valid()"> still dapat result yg sama.. type="submit" OK plak.. kenapa ek?

    ade sape2 bole tolong?
    tq

  2. #2
    Join Date
    Apr 2007
    Location
    KL
    Posts
    20
    Rep Power
    0
    here i post again my problem since the 1st one may not be understandable.
    im having the prob to submit my JSP form using onclick, onblur, onchange function. Here is the example of my code. Quite simple actually but still i cannot get it right.

    <html>
    <form name="Form1" method="post">
    <table>
    <tr><td><input type="text" name="addgrpCde" id="addgrpCde" size=10 maxlength=4 value="<%=ms_grpcde%>" onblur="viewrcd_valid()">
    </td></tr></table></form></html>

    ..in javascript
    function viewrcd_valid()">
    {
    alert ("here");
    document.Form1.action = "IN_ingrpfScript.jsp";
    document.Form1.submit();
    }


    Result:
    -> prompt alert message "here"
    -> get this error: Object Doesn't support this property or method

    Is anyone can help me..its working if i use button (type=submit) but its not the option im looking for because the program may not always in submit action (eg: not submit if validate return false)..

    so i really appreciate of any opinions or solutions..

    tq

  3. #3
    Join Date
    Apr 2004
    Location
    Cheras, Selangor.
    Posts
    457
    Rep Power
    0
    value="<%=ms_grpcde%>"

    The red one is not necessary. Only input from the form.

  4. #4
    Join Date
    Apr 2007
    Location
    KL
    Posts
    20
    Rep Power
    0
    Quote Originally Posted by BasicCX View Post
    value="<%=ms_grpcde%>"

    The red one is not necessary. Only input from the form.
    thanks for the reply.
    The reason i put that <%=ms_grpcde%> is because, what happend is after user enter grpCde, onBlur will submit the page at the same form. Back end, program will retrieve the detail info (like grpDesc, grpItem) and will be display in the same form at their individual textbox or listbox. That's y value=<%=ms_grpcde%> is needed.

    Anyway i did try ur suggestion, but i still got that error.
    The funny part is even i change to use button <input type="button" onClick="viewrcd_valid()"> still faced the same problem and error at document.Form1.submit() line. Seems like it doesnt support submit function.
    is there some setting in IE or my computer or my Eclipse that need to done?
    tq.

  5. #5
    Join Date
    Apr 2004
    Location
    Cheras, Selangor.
    Posts
    457
    Rep Power
    0
    I see. Now i know what you need. In order to get back data to call out into the form, you need to build the form inside the script OR use get function instead of post and some coding of javascript implement into the form. You cannot do that using the simple form above.

  6. #6
    Join Date
    Apr 2007
    Location
    KL
    Posts
    20
    Rep Power
    0
    thanks for reply again..
    maybe i can attach some of my code here.. hehe



    <%@page import="java.util.*" %>
    <%@page import="bgoc.ins.IN_ingrpfQuery"%>
    <%@page import="bgoc.webaccs.UserInfo"%>
    <jsp:useBean id="AddBean" class="bgoc.ins.IN_ingrpfQuery" scope="session" />


    <%

    final String contextPath = request.getContextPath();
    UserInfo uif = (UserInfo) session.getAttribute("UserInfo");
    if (uif == null) {
    response.sendRedirect(contextPath);
    return;
    } else if(!uif.validateNoChange(request)){
    response.sendRedirect(contextPath + "/errorPages/MultiSessionError.jsp");
    return;
    } else if (!uif.chkPage(uif,"IN_ingrpfMtn.jsp","IN_ingrpfScr ipt.jsp")) {
    response.sendRedirect(contextPath);
    return;
    }
    %>
    <%
    String ms_act = request.getParameter("inpAct");
    String ms_grpcde = request.getParameter("grpCde");
    String ms_grpdesc = request.getParameter("grpDesc");
    String ms_um = request.getParameter("grpUM");
    String ms_argl = request.getParameter("grpArGL");
    String ms_arsumry = request.getParameter("grpArSumry");
    String ms_deptcde = request.getParameter("grpArDept");
    String existFlg = "";
    String isReset = "";

    if (ms_act == null) {ms_act = "ADD";}
    if (ms_grpcde == null)
    ms_grpcde = "";
    if (ms_grpdesc == null)
    ms_grpdesc = "";
    if (ms_um == null)
    ms_um = "";
    if (ms_argl == null)
    ms_argl = "";
    if (ms_arsumry == null)
    ms_arsumry = "";


    List<String[]> searchResult=null;
    IN_ingrpfQuery InQ = new IN_ingrpfQuery(uif);

    if (!ms_act.equals("ADD"))
    {
    if (!ms_grpcde.equals(""))
    {
    searchResult = InQ.getIngrpfInfo(ms_grpcde);
    ms_grpdesc = searchResult.get(0)[1];
    ms_um = searchResult.get(0)[2];
    ms_argl = searchResult.get(0)[3];
    ms_arsumry = searchResult.get(0)[4];
    ms_deptcde = searchResult.get(0)[5];
    }
    else{
    isReset = "Y";
    }
    }
    else
    {
    existFlg = InQ.ingrpf_IsExist(ms_grpcde);
    }
    %>

    <html>
    <head>

    <style type="text/css"></style>
    <script type="text/javascript">


    function viewrcd_Onclick()
    {
    var act= document.getElementById("inpAct").value;

    if (act == "ADD")
    document.getElementById("grpCde").value = document.getElementById("addgrpCde").value;
    else
    document.getElementById("grpCde").value = document.getElementById("updgrpCde").value;

    if (document.getElementById("grpCde").value == "")
    {
    alert ("Please enter Group Code");
    if (act == "ADD")
    document.Form1.addgrpCde.focus();
    else
    document.Form1.updgrpCde.focus();

    return false;
    }
    else
    {
    alert ("here");
    document.Form1.submit();
    //return true;
    }
    }


    function validate_entry(as_act)
    {
    var ls_msg="";
    var ls_focus="";
    var ls_command= "";

    if (document.getElementById("grpArDept").value == "" ){
    ls_msg = "Please enter Group AR Department";
    ls_focus = "grpArDept";
    }
    if (document.getElementById("grpArSumry").value == ""){
    ls_msg = "Please enter Group AR Summary";
    ls_focus = "grpArSumry";
    }
    if ((document.getElementById("grpArGL").value == "")){
    ls_msg = "Please enter Group AR G/L";
    ls_focus = "grpArGL";
    }
    if (document.getElementById("grpUM").value == ""){
    ls_msg = "Please enter Group UP";
    ls_focus = "grpUM";
    }
    if (document.getElementById("grpDesc").value == ""){
    ls_msg = "Please enter Group Description";
    ls_focus = "grpDesc";
    }
    if (document.getElementById("grpCde").value == ""){
    ls_msg = "Please enter Group Code";
    if (as_act=="ADD")
    ls_focus = "addgrpCde";
    else
    ls_focus = "updgrpCde";
    }

    if (ls_msg != "")
    {
    alert(ls_msg);
    if (ls_focus != "")
    {
    ls_command = "document.Form1."+ ls_focus + ".focus();"
    window.execScript (ls_command);
    }
    return false;
    }

    return true;

    }


    </script>

    <title>Item Group Code Maintenance</title>

    </head>
    <body onload="initialize();">

    <form name="Form1" method="get" >
    <table border="0" width="100%">
    <tr>
    <%//create hidden field to keep the value %>
    <td align="right">
    <input type="button" name="ADD" value="ADD" onclick="javascript:Action_OnClick('ADD')">&nbsp;
    <input type="button" value="UPDATE" onclick="javascript:Action_OnClick('UPD')">&nbsp;
    <input type="button" value="DELETE" onclick="javascript:Action_OnClick('DEL')">&nbsp;
    <input type="button" value="INQUIRY" onclick="javascript:Action_OnClick('INQ')">
    </td>
    </tr>
    <tr>
    <%//TO display Current Proses %>
    <td align="right"><font size=2px> <b>Current Process:</b></font> &nbsp;<input type="text" name="inpAct" id="inpAct" size=4 READONLY></td>
    </tr>
    </table>


    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="60%"><font color="#003399" size="4"><b>Item Group Code</b></font></td>
    </tr>
    </table>

    <hr color="#99CCFF" width="1000px" size="4">
    <table width="100%">
    <tr>
    <td width=5% align=right>&nbsp;<font color=red>*</font></td>
    <td width=15% align=left><font class="fonttext">Item Group Code</td>
    <td>:</td>
    <td name="tdUpdGrpCde" id="tdUpdGrpCde" style="display:none" >
    <select name="updgrpCde" id="updgrpCde" onChange="return viewrcd_Onclick();">
    <%=AddBean.LoadComboList(uif,ms_grpcde,1,"ingrpf", "ig_grp_cde, ig_grp_desc","ig_grp_cde")%>
    </select>
    &nbsp;
    <input type="submit" name="view" value="View" style="display:inline" onclick="viewrcd_Onclick();">&nbsp;

    </td>
    <td name="tdAddGrpCde" id="tdAddGrpCde" style="display:inline" >
    <input type="text" name="addgrpCde" id="addgrpCde" size=10 maxlength=4 value="<%=ms_grpcde%>" onChange="viewrcd_Onclick();">
    &nbsp;
    <input type="button" name="checkExist" value="Check Exist" style="display:inline" onClick="viewrcd_Onclick();">&nbsp;
    </td>

    </tr>
    <tr>
    <td width=5% align=right>&nbsp;<font color=red>*</font></td>
    <td width=15% align=left><font class="fonttext">Item Code Description</font></td>
    <td>:</td>
    <td><input name="grpDesc" id="grpDesc" value="<%=ms_grpdesc%>" nametype=text size=35 maxlength=30/>&nbsp; </td>
    </tr>
    <tr>
    <td width=5% align=right>&nbsp;<font color=red>*</font></td>
    <td width=15% align=left><font class="fonttext">Unit of Measure</font></td>
    <td>:</td>
    <td>
    <select name="grpUM" id="grpUM" READONLY >
    <%=AddBean.LoadComboList(uif,ms_um,2,"inum","iu_cd e, iu_desc","iu_cde")%>
    </select>
    </td>
    </tr>
    </table>

    <table border="0" width="100%">
    <tr>
    <%//create hidden field to keep the value %>
    <td align="center">
    <input type="hidden" name="grpCde" id="grpCde" value="<%=ms_grpcde%>">
    <input type="submit" name="submit" value="Submit" onclick="Submit_Onclick();">&nbsp;
    <input type="button" value="Reset" onclick="refresh();">&nbsp;
    <input type="button" value="Main Menu" onclick="window.location = '../../index.jsp';">&nbsp;
    <input type="button" value="Logout" onclick="location.href='../../logout.jsp'">
    </td>
    </tr>
    </table>
    </form>

    </body>
    </html>

  7. #7
    Join Date
    Apr 2007
    Location
    KL
    Posts
    20
    Rep Power
    0
    the prob is..even i click "checkExist" button or onChange at "addgrpCde" textbox(using same function:viewrcd_Onclick() still face the same error.

    The error point at javascript viewrcd_Onclick() function at
    line document.Form1.submit();

    i try to use onChange at combolist, still have that error..
    what happened eh? pening already..
    thanks a lot for ur time ,BasicCX

  8. #8
    Join Date
    Apr 2007
    Location
    KL
    Posts
    20
    Rep Power
    0
    finally..
    i already find what cause this prob. Just a simple or silly mistake.. The prob is because i declare one button with a name=submit. i think it effect javascript submit method.
    it works fine after i rename the button to other name.
    Tq for the time n helps..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 405 Method Not Allowed
    By yipguseng in forum Website Programming
    Replies: 2
    Last Post: 17-01-2007, 11:43 AM
  2. Check box & other form object in ASP
    By mdms in forum Website Programming
    Replies: 1
    Last Post: 19-12-2003, 07:42 PM
  3. questions on Sound Object in Flash
    By denian in forum Website Design
    Replies: 3
    Last Post: 31-01-2003, 02:47 PM
  4. Win XP and asp3.0 session object
    By syahrezan in forum Website Programming
    Replies: 16
    Last Post: 10-05-2002, 02:49 PM
  5. method of paying
    By antagonis in forum Paid Hosting Discussion Forum
    Replies: 3
    Last Post: 29-03-2002, 07:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

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