Results 1 to 2 of 2

Thread: Submit button is not clickable.

  1. #1
    Join Date
    Jul 2008
    Posts
    182

    Default Submit button is not clickable.

    Hi, I am using Spring mvc 3.1 with jsp.
    There is a submit form written in the jsp file.
    The submit button is not clickable.

    Here is my jsp file:

    Code:
    <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
    <%@taglib  uri="http://www.springframework.org/tags" prefix="spring" %>
    <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
    <!--==============================header=================================-->
    
    <nav>
        <div class="main">
          <ul class="sf-menu">
                <li><a href="../"><span><span>Home</span></span></a></li>
                <li><a href=""><span><span>Manage Categories</span></span></a></li>
                <li class="current"><a href="../suppliers/supplierPage"><span><span>Manage Suppliers</span></span></a></li>
                <li><a href=""><span><span>Manage Product</span></span></a>
                    <c:if test="${not empty categoryList}">
                    <ul>
                        <c:forEach var="category" items="${categoryList}">
                        
                        <c:choose>
                            <c:when test="${selectedCategoryId == category.categoryId}">
                               <li><a href="../products/productPage?categoryId=${category.categoryId}"><b>by category "${category.categoryName}"</b></a></li>
                            </c:when>
                            <c:otherwise>
                                <li><a href="../products/productPage?categoryId=${category.categoryId}">by category "${category.categoryName}"</a></li>
                            </c:otherwise>
                        </c:choose>
            
                        </c:forEach>
                    </ul>
                    </c:if>
                </li>
    
            </ul>
            <form id="form-search" method="post">
                <input type="text" value="Search..." onBlur="if(this.value=='') this.value='Search...'" onFocus="if(this.value =='Search...' ) this.value=''" /><a href="#" onClick="document.getElementById('form-search').submit()"></a>     
            </form>
        </div>    
        <div class="clear"></div>
    </nav>
    <header>
    	<div class="wrapper">
            <h1><a href="index.html"><img src="images/logo.png" alt="Exterior" title="Exterior"></a></h1>
            <div class="icons"><a href="#" class="icon-1 tooltip" title="Twitter"></a><a href="#" class="icon-2 tooltip" title="Facebook"></a><a href="#" class="icon-3 tooltip" title="Flickr"></a></div>
        </div>
        
        <div class="clear"></div>  
    </header>
    
    <!--==============================content================================-->
    <section id="content" class="top-4">
    	<div class="container_12">
                <!-- contact foam -->
               <div class="grid_5">
            	<h2 class="bot-2">Supplier Edit <strong>Form</strong></h2>
                <c:url var="saveUrl" value="/suppliers/save" />
                <form:form id="form" modelAttribute="vendorAttribute" method="POST" action="${saveUrl}">
                  <div class="success">Supplier Edit Form submitted!<br>
                  <strong>We will be in touch soon.</strong> </div>
    
                      <form:label path="id">Id:</form:label>
                      <form:input path="id" disabled="false"/>
    
                  <input type="submit" value="submit">
                </form:form>
            </div>
    <!-- end of contact foam -->
    Contorller:

    Code:
    @Controller
    @RequestMapping(value = "/suppliers")
    public class SupplierController {
            private static final Logger logger = Logger.getLogger(SupplierController.class);
    
            private VendorService vendorService;
    
    	ServletConfig config;
    
            @Autowired
            public SupplierController(VendorService vendorService) {
                this.vendorService = vendorService;
            }
            
             @RequestMapping(value = "/save", method = RequestMethod.POST)
        public String saveEdit(@ModelAttribute("vendorAttribute") TestUser testUser, Model model) {                             
    
                logger.debug("======saveSupplier=======");
    		return "supplierPage";
    	}
    
    }
    Any suggestion is very appreciated.
    Thanks
    Sam

  2. #2
    Join Date
    Apr 2006
    Posts
    166

    Default

    Hello

    If the button is not click-able, you have something wrong in jsp, try to open the form to view source html code to make sure that your jsp code is correct first. Also, should have a simple form without any javascript that make your code clean

Posting Permissions

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