Code HTML

Go down

Solved Code HTML

Post by Miau on August 12th 2018, 12:41 am

Good evening, I would like an html page that generates an alert code I already have, how would it work?
A page with place for Name and Position, and with the options "Flood", "invasions" and etc, then with this select would generate the code to copy and paste


Last edited by Miau on August 14th 2018, 9:30 pm; edited 1 time in total
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by Luffy on August 12th 2018, 12:50 am

Hello @Miau,

I didn't understand what you want to do. To generate an alert you can use this code:
Code:
$(function(){
  alert('My alert');
});

Now what you want to do, can differ from this code but you have to add more details so I can help you more here. Sorry.
avatar
Luffy
Manager
Manager

Male Posts : 5636
Reputation : 628
Language : Greek, English
Location : Cyprus, Greece

https://help.forumotion.com

Back to top Go down

Solved Re: Code HTML

Post by Miau on August 12th 2018, 12:57 am

So I have the alert codes I made in html, so I would like an html page that contains the codes I made
are alert, flood, invasion and etc codes, so on the html page would have the options "flood, alerts" I would choose the option there would appear the code I have already created
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by pedxz on August 12th 2018, 1:03 am

Hey @Miau,
Something like this?
Code:
<script type="text/javascript">
  $(document).ready(function() {
 
    $("#form").on("submit", function(e) {
          e.preventDefault();
          var form = $(this);
          if(validateFields(form)) {
              form.find("[name='resultado']").val(form.find("[name='pre-definicoes']").val());
          }
      });
 
});
 
  function validateFields(e) {
        var result = true;
        $(e).find("input, select").each(function() {
            if($(this).val() == "" || $(this).val() == null) {
                result = false;
            }
        });
        return result;
    }
</script>
    <form id="form">
 
        <select name="pre-definicoes" required>
          <option value="This mensage is law 1">Law 1</option>
          <option value="This mensage is to law 2">Law 2</option>
        </select>
                 
        <button type="submit">Generate</button>
 
      <textarea onmouseover="this.select();" rows="5" name="resultado" placeholder="Select an option to be generated."></textarea>
               
                </form>
avatar
pedxz
Forumember

Male Posts : 134
Reputation : 27
Language : speaker daemonium & português
Location : Portugal

http://ajuda.forumeiros.com/u62843

Back to top Go down

Solved Re: Code HTML

Post by Miau on August 12th 2018, 1:35 am

this pedxz, almost there, now I want the options
Programmer, manager, administrator, moderator, helper and coordinator.
and the options
Flood
Materials posted
disclosure
Avatar and Signature
Discussions
Topic Invasion
Raise topics
Report Button Misuse
Excessive Alerts
Disrespect to Staff members (forum / server)
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by pedxz on August 12th 2018, 3:11 pm

Programmer, manager, administrator, moderator, helper and coordinator.
I didn't realize this part, what do you mean


About the warns:
Code:
<script type="text/javascript">
  $(document).ready(function() {
 
    $("#form").on("submit", function(e) {
          e.preventDefault();
          var form = $(this);
          if(validateFields(form)) {
              form.find("[name='resultado']").val(form.find("[name='pre-definicoes']").val());
          }
      });
 
  });
 
  function validateFields(e) {
        var result = true;
        $(e).find("input, select").each(function() {
            if($(this).val() == "" || $(this).val() == null) {
                result = false;
            }
        });
        return result;
    }
</script>
<form id="form">
  <select name="pre-definicoes" required>
      <option value="Attention: [b]Flood[/b]">Flood</option>
      <option value="Attention: [b]Materials posted[/b]">Materials posted</option>
      <option value="Attention: [b]Disclosure[/b]">Disclosure</option>
      <option value="Attention: [b]Avatar and Signature[/b]">Avatar and Signature</option>
      <option value="Attention: [b]Discussions[/b]">Discussions</option>
      <option value="Attention: [b]Topic Invasion[/b]">Topic Invasion</option>
      <option value="Attention: [b]Raise topics[/b]">Raise topics</option>
      <option value="Attention: [b]Report Button Misuse[/b]">Report Button Misuse</option>
      <option value="Attention: [b]Excessive Alerts[/b]">Excessive Alerts</option>
      <option value="Attention: [b]Disrespect to Staff members (forum / server)[/b]">Disrespect to Staff members (forum / server)</option>
  </select>
  <button type="submit">Generate</button>
  <textarea onmouseover="this.select();" rows="5" name="resultado" placeholder="Select an option to be generated."></textarea>
</form>
avatar
pedxz
Forumember

Male Posts : 134
Reputation : 27
Language : speaker daemonium & português
Location : Portugal

http://ajuda.forumeiros.com/u62843

Back to top Go down

Solved Re: Code HTML

Post by Miau on August 12th 2018, 5:45 pm

Try to explain, it would be like this, a place for the name, one to select the position and another to select the type of alert.
Example,
Name: Pedxz
Position: Manager
Type alert: Flood
that would generate this code https://prnt.sc/khpcu6
replacing the nick field that I put in and replacing the "coordinator" with the position that was selected
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by SLGray on August 12th 2018, 8:25 pm

Are you trying to create a report system?  If yes, you do know there is already a report system?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 43893
Reputation : 3124
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Solved Re: Code HTML

Post by Miau on August 13th 2018, 8:49 pm

I already have an alert system in html, I want a hmtl page that has my codes
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by pedxz on August 13th 2018, 11:53 pm

Change to:
Code:
<script type="text/javascript">
  $(document).ready(function() {
 
    $("#form").on("submit", function(e) {
          e.preventDefault();
          var form = $(this), user = _userdata["username"];
          $('#user').val(user);
          if(validateFields(form)) {
              form.find("[name='resultado']").val('[b]Name[/b]: ' + form.find("[name='name']").val() + '\\\n[b]Position[/b]: ' + form.find("[name='ranks']").val() + '\\\n[b]Type Alert[/b]: ' + form.find("[name='laws']").val());
          } else {
              alert("You forgot to fill something!");
          }
      });
 
  });
 
  function validateFields(e) {
        var result = true;
        $(e).find("input, select").each(function() {
            if($(this).val() == "" || $(this).val() == null) {
                result = false;
            }
        });
        return result;
    }
</script>
<form id="form">
  <input type="hidden" name="name" id="user">
    <select name="ranks" required>
      <option value="Admin">Admin</option>
      </select>
  <select name="laws" required>
      <option value="Flood">Flood</option>
      <option value="Materials posted">Materials posted</option>
      <option value="Disclosure">Disclosure</option>
      <option value="Avatar and Signature">Avatar and Signature</option>
      <option value="Discussions">Discussions</option>
      <option value="Topic Invasion">Topic Invasion</option>
      <option value="Raise topics">Raise topics</option>
      <option value="Report Button Misuse">Report Button Misuse</option>
      <option value="Excessive Alerts">Excessive Alerts</option>
      <option value="Disrespect to Staff members (forum / server)">Disrespect to Staff members (forum / server)</option>
  </select>
  <button type="submit">Generate</button>
  <textarea onmouseover="this.select();" rows="5" name="resultado" placeholder="Select an option to be generated."></textarea>
</form>

All you need to do is fill out as you want :wouhou:
avatar
pedxz
Forumember

Male Posts : 134
Reputation : 27
Language : speaker daemonium & português
Location : Portugal

http://ajuda.forumeiros.com/u62843

Back to top Go down

Solved Re: Code HTML

Post by Miau on August 14th 2018, 12:57 am

This, pedxz, we are almost there, missing the part of nick.
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by pedxz on August 14th 2018, 8:06 am

the part of the username is hidden and is automatic, do you want it to be manual?
avatar
pedxz
Forumember

Male Posts : 134
Reputation : 27
Language : speaker daemonium & português
Location : Portugal

http://ajuda.forumeiros.com/u62843

Back to top Go down

Solved Re: Code HTML

Post by Miau on August 14th 2018, 7:17 pm

Oh Ok, no problem
Go to test
Now the Flood alert type needs to generate this code
Code:
<table style="border-left-width: 3px; border-left-style: solid; border-left-color: #23E605; border-right-width: 3px; border-right-style: solid; border-right-color: #23E605; margin: 10px auto; padding: 5px; border-radius: 4px; box-shadow: #FF0000 0px 5px 9px; max-height: 2500px; max-width: 2500px; z-index: 999; min-width: 1px; min-height: 1px; background: url("http://bit.ly/acLmW9");"><tbody><tr><td><img src="https://cdn4.iconfinder.com/data/icons/32x32-free-design-icons/32/Warning.png" alt=""></td><td><strong><font color="red" size="1">A sua <u>Barra de Alerta</u> aumentou em <i><font color="BLUE">10%</i></font> por violar as Regras do Fórum.</strong></font>
<strong><font size="0">Regras Violadas:</strong>
1.1 Flood: É proibido o flood. Caracteriza-se:
 -Quando é feito postagens seguidas, ou seja, postagem atrás de postagem;
 -Quando o usuário repete mensagens postadas acima em curto espaço de tempo;
 -Quando o usuário cita uma mensagem dita acima e não escreve nada mais ou faz uso de smileys;
 -Quando o usuário foge do contexto do tópico;
 -Quando são feitas postagens em curto intervalo de tempo em diferentes tópicos (clique aqui para ver um exemplo);
 -Fazer UP em tópico em menos de 24 horas;</font>
<font color="red" size="1">Evite transtornos, leia as </font><font size="0"><a href="http://www.nwdgames.com/t63857-regras-do-forum" target="_blank"><strong>Regras do Fórum</strong></a></strong></font>
<strong><font size="1">Atenciosamente,</font></strong>
<strong><font color="#ff0aff" size="1">COLOQUE_AQUI_SEU_NICK - Coordenador</font></strong>
</td></tr></tbody></table>
Substituting the part "COORDINATOR" for the current position in the forum and his nickname in CHOOSE YOUR NICKNAME
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by pedxz on August 14th 2018, 8:25 pm

@Miau wrote:Oh Ok, no problem
Go to test
Now the Flood alert type needs to generate this code
Code:
<table style="border-left-width: 3px; border-left-style: solid; border-left-color: #23E605; border-right-width: 3px; border-right-style: solid; border-right-color: #23E605; margin: 10px auto; padding: 5px; border-radius: 4px; box-shadow: #FF0000 0px 5px 9px; max-height: 2500px; max-width: 2500px; z-index: 999; min-width: 1px; min-height: 1px; background: url("http://bit.ly/acLmW9");"><tbody><tr><td><img src="https://cdn4.iconfinder.com/data/icons/32x32-free-design-icons/32/Warning.png" alt=""></td><td><strong><font color="red" size="1">A sua <u>Barra de Alerta</u> aumentou em <i><font color="BLUE">10%</i></font> por violar as Regras do Fórum.</strong></font>
<strong><font size="0">Regras Violadas:</strong>
1.1 Flood: É proibido o flood. Caracteriza-se:
 -Quando é feito postagens seguidas, ou seja, postagem atrás de postagem;
 -Quando o usuário repete mensagens postadas acima em curto espaço de tempo;
 -Quando o usuário cita uma mensagem dita acima e não escreve nada mais ou faz uso de smileys;
 -Quando o usuário foge do contexto do tópico;
 -Quando são feitas postagens em curto intervalo de tempo em diferentes tópicos (clique aqui para ver um exemplo);
 -Fazer UP em tópico em menos de 24 horas;</font>
<font color="red" size="1">Evite transtornos, leia as </font><font size="0"><a href="http://www.nwdgames.com/t63857-regras-do-forum" target="_blank"><strong>Regras do Fórum</strong></a></strong></font>
<strong><font size="1">Atenciosamente,</font></strong>
<strong><font color="#ff0aff" size="1">COLOQUE_AQUI_SEU_NICK - Coordenador</font></strong>
</td></tr></tbody></table>
Substituting the part "COORDINATOR" for the current position in the forum and his nickname in CHOOSE YOUR NICKNAME


Done
Code:
<script type="text/javascript">
  $(document).ready(function() {
 
    $("#form").on("submit", function(e) {
          e.preventDefault();
          var form = $(this), user = _userdata["username"];
          $('#user').val(user);
          if(validateFields(form)) {
              form.find("[name='resultado']").val(
                  ' <table style="border-left-width: 3px; border-left-style: solid; border-left-color: #23E605; border-right-width: 3px; border-right-style: solid; border-right-color: #23E605; margin: 10px auto; padding: 5px; border-radius: 4px; box-shadow: #FF0000 0px 5px 9px; max-height: 2500px; max-width: 2500px; z-index: 999; min-width: 1px; min-height: 1px; background: url("http://bit.ly/acLmW9");">' +
                  ' <tbody><tr><td><img src="https://cdn4.iconfinder.com/data/icons/32x32-free-design-icons/32/Warning.png" alt=""></td><td>' +
                  ' <strong><font color="red" size="1">A sua <u>Barra de Alerta</u> aumentou em <i><font color="BLUE">10%</i></font> por violar as Regras do Fórum, ' + form.find("[name='laws']").val() + '.</strong></font>' +
                  ' <strong><font size="0">Regras Violadas:</strong>' +
                  ' 1.1 Flood: É proibido o flood. Caracteriza-se:\\\n' +
                  ' -Quando é feito postagens seguidas, ou seja, postagem atrás de postagem;\\\n' +
                  ' -Quando o usuário repete mensagens postadas acima em curto espaço de tempo;\\\n' +
                  ' -Quando o usuário cita uma mensagem dita acima e não escreve nada mais ou faz uso de smileys;\\\n' +
                  ' -Quando o usuário foge do contexto do tópico;\\\n' +
                  ' -Quando são feitas postagens em curto intervalo de tempo em diferentes tópicos (clique aqui para ver um exemplo);\\\n' +
                  ' -Fazer UP em tópico em menos de 24 horas;</font>\\\n' +
                  ' <font color="red" size="1">Evite transtornos, leia as </font><font size="0"><a href="http://www.nwdgames.com/t63857-regras-do-forum" target="_blank"><strong>Regras do Fórum</strong></a></strong></font>\\\n' +
                  ' <strong><font size="1">Atenciosamente,</font></strong>' +
                  ' <strong><font color="#ff0aff" size="1">' + form.find("[name='name']").val() + ' - ' + form.find("[name='ranks']").val() + '</font></strong>' +
                  '</td></tr></tbody></table>'
                    );
          } else {
              alert("You forgot to fill something!");
          }
      });
 
  });
 
  function validateFields(e) {
        var result = true;
        $(e).find("input, select").each(function() {
            if($(this).val() == "" || $(this).val() == null) {
                result = false;
            }
        });
        return result;
    }
</script>
<form id="form">
  <input type="hidden" name="name" id="user">
    <select name="ranks" required>
      <option value="Admin">Admin</option>
      </select>
  <select name="laws" required>
      <option value="Flood">Flood</option>
      <option value="Materials posted">Materials posted</option>
      <option value="Disclosure">Disclosure</option>
      <option value="Avatar and Signature">Avatar and Signature</option>
      <option value="Discussions">Discussions</option>
      <option value="Topic Invasion">Topic Invasion</option>
      <option value="Raise topics">Raise topics</option>
      <option value="Report Button Misuse">Report Button Misuse</option>
      <option value="Excessive Alerts">Excessive Alerts</option>
      <option value="Disrespect to Staff members (forum / server)">Disrespect to Staff members (forum / server)</option>
  </select>
  <button type="submit">Generate</button>
  <textarea onmouseover="this.select();" rows="5" name="resultado" placeholder="Select an option to be generated."></textarea>
</form>

Embarassed
avatar
pedxz
Forumember

Male Posts : 134
Reputation : 27
Language : speaker daemonium & português
Location : Portugal

http://ajuda.forumeiros.com/u62843

Back to top Go down

Solved Re: Code HTML

Post by Miau on August 14th 2018, 8:33 pm

One question, instead, is how do I add all the alerts at once in ScEditor?
As if it were moderating messages
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by pedxz on August 14th 2018, 9:11 pm

Like this:

?

do not forget that only one request per topic is valid, and this is already leaving the context of the topic Very good
avatar
pedxz
Forumember

Male Posts : 134
Reputation : 27
Language : speaker daemonium & português
Location : Portugal

http://ajuda.forumeiros.com/u62843

Back to top Go down

Solved Re: Code HTML

Post by Miau on August 14th 2018, 9:29 pm

Yes, this, you can close this topic
avatar
Miau
Forumember

Posts : 65
Reputation : 1
Language : Portuguese

https://nwdgames.com

Back to top Go down

Solved Re: Code HTML

Post by mpelmmc on August 14th 2018, 9:33 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules



Rules of the forum - Frequently Asked Questions - Have you lost your password?
Please mark the "solved" button if your problem/doubt has been solved.
avatar
mpelmmc
Support Moderator
Support Moderator

Male Posts : 676
Reputation : 103
Language : English and Spanish

http://asistencia.foroactivo.com/forum

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum