Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JavaScript Function

Featured Replies

Hello everybody. You are my last hope. I'm beginner in the web design. I used a template to make my first web site, but I need help for a JS function. I'm from Bulgaria. A while ago here appeared some web sites which offer gifts for points. Also there are a lot of sites which are just for exchanging points, I made such one. Here is the code of the voting page:

 

<script language="JavaScript">

var message="Десният бутон е забранен.";

function clickIE4(){

if (event.button==2){

alert(message);

return false;

}

}

 

function clickNS4(e){

if (document.layers||document.getElementById&&!document.all){

if (e.which==2||e.which==3){

alert(message);

return false;

}

}

}

 

if (document.layers){

document.captureEvents(Event.MOUSEDOWN);

document.onmousedown=clickNS4;

}

else if (document.all&&!document.getElementById){

document.onmousedown=clickIE4;

}

 

document.oncontextmenu=new Function("alert(message);return false")

</script>

 

<script>var count = 241;

var a = 0;

var b = 0;

var c = 0;

var t = 0;

var name;

 

function vote(name) {

 

if (document.send.elements["name"].value == "") alert('Първо попълни името си в ######!');

else {

if (document.send.elements["skype"].value == "") alert('Първо попълни скайп името си!');

else {

if (a == 0) {

check();

timer();

} else {

if (b < 80) {

c++;

}

b = 0;

};

a++;

document.getElementById(name).innerHTML = "";

window.open("http://######/"+name,'vote','width=950,height=500');

if (a == count) {

ready();

}

}

}

}

 

function check() {

b++;

setTimeout("check()", 10);

}

 

function timer() {

t++;

setTimeout("timer()", 1000);

}

 

function ready() {

document.send.elements["time"].value = t;

document.send.elements["timeout"].value = c;

document.getElementById("button").innerHTML = "<input type='submit' name='submit' />";

document.send.elements['submit'].click();

}

 

</script>

 

 

And this is the automatic form which submit Skype name and name in the specific site:

 

<!-- Begin Response-O-Matic Form -->

<!-- DO NOT EDIT YOUR FORM HERE, PLEASE LOG IN AND EDIT AT RESPONSE-O-MATIC.COM -->

<form enctype="multipart/form-data" method="post" action="http://www.response-o-matic.com/mail.php" accept-charset="UTF-8">

<div>

<input type="hidden" name="acctid" id="acctid" value="8ekvkv09jmex15av" />

<input type="hidden" name="formid" id="formid" value="920240" />

<input type="hidden" name="required_vars" id="required_vars" value="name,skype" />

</div>

<table cellspacing="5" cellpadding="5" border="0">

<tr>

<td valign="top">

<strong class="danni">Име:</strong>

</td>

<td valign="top">

<input class="sending" type="text" name="name" id="name" size="40" value="" />

 

</td>

</tr>

<tr>

<td valign="top">

<strong class="danni">Skype:</strong>

</td>

<td valign="top">

<input class="sending" type="text" name="skype" id="skype" size="40" value="" />

 

</td>

</tr>

<tr>

<td colspan="2" align="center">

<input id="subm" class="sending" type="submit" value="Submit Form" />

</td>

</tr>

</table>

</form>

<br><center><font face="Arial, Helvetica" size="1">

<br/>

<div id="footer">

 

</div>

<b>

This <a href="http://www.response-o-matic.com">HTML form</a> was created by Freedback.

</b></font></center>

<!-- End Response-O-Matic Form -->

 

Here is such type of site: http://nagradivote.ovo.bg/ and this is my unfinished one: http://nagraditepoll.co.cc

 

The problem is the following: I must receive an e-mail which contains: Skype and the site names and number of the missed buttons (if there are missed), but I receive only both names, without the "missed". Please help me. Maybe this is something very simple but I can't do it... Thanks in advance. :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.