Vote count:
0
I have two input field through which I select date and time.Now I want to show that startdate should be always less than enddate.If it is not, then then error message should be displayed showing "enddate has to be greater" .The code for input fields is
<input id="startdate" type="text" size="25" name="startdate"
onclick="javascript:NewCal('startdate','ddmmmyyyy',true,24)" >
<a>
<img src="images/cal.gif" width="10" height="10" border="0" alt="Pick a date">
</a>
<input id="enddate" type="text" size="25" name="enddate" onclick="javascript:NewCal('enddate','ddmmmyyyy',true,24)" >
<a>
<img src="images/cal.gif" width="10" height="10" border="0" alt="Pick a date">
</a>
<c:if test="${enddate < startdate}">
<c:out value="Endate date should be greater than start date"></c:out> </c:if>
<input type="submit" value="Submit"><br>
</form>
I have tried it with tag of jstl but its not working.If I select enddate less than startdate, then no error message is shown. What I'm doing wrong.Can't I use the id of input field in tag of JSTL?
asked 35 secs ago
comparing two values from the input field in c:if tag of jstl
Aucun commentaire:
Enregistrer un commentaire