<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:body>
<h:form id="myForm">
Katar Değeri :
<h:inputText id="myInput" value="#{scriptBean.stringValue}"/> <br/>
<br/>
Betik Onaylama :
<h:commandLink
value="Git"
action="#{scriptBean.process()}"
onclick="if (!confirm('Emin misin?'))
return false;"
/><br/>
<br/>
<script type="text/javascript">
function myFunction() {
alert("İşleniyor");
var myInput = document.getElementById("myForm:myInput").value;
alert("Girdi " + myInput+" boyu "+ myInput.length);
if (myInput.length < 3){
alert("Girdi en az 3 karakterli olmalı");
return false;
}
alert("Formu gönder!");
return true;
}
</script>
Betik İşlevi :
<h:commandButton
value="Git"
action="#{scriptBean.process()}"
onclick="return myFunction();"
/><br/>
<br/>
</h:form>
</h:body>
</html>
Dosyayı İndir