Jump to content
php.lv forumi

auto reaload


yeahz

Recommended Posts

Kāpēc pēc šāda koda:

<script type="text/javascript">
function notEmpty(elem, elem2, elem3){
if (elem.value.length == 0 || elem.value == "Message..."){
	alert('Don\'t leave empty Message field!');
	elem.focus();
	return false;
} else if (elem2.value.length == 0 || elem2.value == "Your name..."){
	alert('Don\'t leave empty Your name field!');
	elem2.focus();
	return false;
} else if (elem3.value.length == 0 || elem3.value == "Your email (will not be published)..."){
	alert('Don\'t leave empty Your email field!');
	elem3.focus();
	return false;
} else {
	return true;
}
}
</script>

nospiežot OK pēc alerta paziņojuma, lapa pārlādējas? Es nergibu lai pārlādejas.

Edited by yeahz
Link to comment
Share on other sites

No kurienes tiek izsauktas funkcija?

ja no <a> tag`a, tad, ja onclick funkcija atgriež true, tiek izpildīts href lauks...

 

 

<a href="http://www.google.lv" onclick="doSmtn(1);">Ejam uz gūgli</a>
<a href="http://www.google.lv" onclick="doSmtn(2);">NEEJAM uz gūgli</a>

<script>
function doSmtn(i){
if(i == 1){
return true;
}
if(i == 2){
return false;
}


}

</script>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...