View: 1816|Reply: 5
|
Dreamweaver: form validation, nk minimum characters
[Copy link]
|
|
nak tumpang tnya laa...mcmna nak validate kan form yg akan diisi oleh user ... nk minimum kan character tu dari 6 character jer....n maximum is 12 character. yg tau maximum character jer....minimum tak tau |
|
|
|
|
|
|
|
Reply #1 mofarby's post
Sorry, aku tengah sibuk sket ni... hopefully akan ada orang tolong ko settlekan issue ni. Maybe besok aku leh masuk tolong ko pasal ni. Good luck. |
|
|
|
|
|
|
|
nape tak pakai javascript je? ko pnya form ni dalam web based ke?html? or..... |
|
|
|
|
|
|
|
haah...web based pkai utk buat php nyer page. kalau pkai javascript ada tak script dia? tp javascript ni kadang2 dia tk run bler dah msuk dlm coding tu...contohnyer javascript utk no right click...bler msuk jer tp still bleh right click. ermm...helpp... |
|
|
|
|
|
|
|
<script language="JavaScript" >
function validateRequired(objInput)
{
if (objInput.value == "")
{
alert("Required fields.");
}
}
function validateMinLength(objInput,sValue)
{
if (objInput.value != "" && objInput.value.length < sValue)
{
alert("Min " + sValue + " characters. ");
}
}
function validateMaxLength(objInput,sValue)
{
if (objInput.value != "" && objInput.value.length> sValue)
{
alert("Max " + sValue + " characters. ");
}
}
</script>
kat form
<input type="input1" name="input1" onchange="validateMinLength(this, 4);
aku tak test jalan ke tak... try dulu |
|
|
|
|
|
|
| |
|