Note that there are some explanatory texts on larger screens.

plurals
  1. POdisplaying error-messages in speech-bubbles using jquery/css3
    primarykey
    data
    text
    <p>hey there for now i am using this scripts for checking the input in my username-field:</p> <pre><code>// username-check $(document).ready(function(){ $("#username-field").keyup(function(event) { $.post("checkUsername.php", { username: $(this).val() }, function(data) { $("#name-error").text(data.error ? data.error : ""); }, "json"); }); }); </code></pre> <p>this jQuery is sending the typed data to an other php-script: here it is, chechUsername.php:</p> <pre><code>include "storescripts/connect_to_mysql.php"; require 'classes/UsernameChecker.php'; $config = array('DB' =&gt; $mysqli, 'Table' =&gt; 'table', 'Row' =&gt; 'row', 'Output' =&gt; true, 'Format' =&gt; 'JSON'); $usernameChecker = new UsernameChecker($config); if(!empty($_POST['username'])) { if ($usernameChecker-&gt;check_regex($_POST['username'])) { if($usernameChecker-&gt;check_length($_POST['username'])) { if (!$usernameChecker-&gt;check($_POST['username'])) { echo json_encode(array("error" =&gt; "Username already taken")); } else { echo json_encode(array("error" =&gt; "Username available")); } } else { echo json_encode(array("error" =&gt; "Username too long")); } } else { echo json_encode(array("error" =&gt; "Allowed symbols: a-z , A-Z , 1-9 and \"_\"")); } } else { echo json_encode(array("error" =&gt; "Type username")); } </code></pre> <p>depending on the input, i created some error-messages. those error-messages are displayed in:</p> <pre><code>&lt;span class="error" id="name-error"&gt;&lt;/span&gt; </code></pre> <p>now i want to diplay this error-messages in speech-bubbles instead, anybody got a good solution or a good tutorial or a jsfiddle for solving my problem? greetings!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload