/    Sign up×
Community /Pin to ProfileBookmark

Can you help check form

Can you help check form
`<html>
<head>
<title></title>

<script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js”></script>
<script src=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js”></script>
<script src=”https://www.jqueryscript.net/demo/Responsive-WYSIWYG-Text-Editor-with-jQuery-Bootstrap-LineControl-Editor/editor.js”></script>

<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css”>
<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css”>
<link href=”https://www.jqueryscript.net/demo/Responsive-WYSIWYG-Text-Editor-with-jQuery-Bootstrap-LineControl-Editor/editor.css” type=”text/css” rel=”stylesheet”/>

<script type=”text/javascript”>

$(document).ready( function() {
$(“#txtEditor”).Editor();

});

function submit() {
var group = $(‘input:checkbox’).filter(‘:checked’).length;
var users = $(‘input[id=users]:checked’).length;
var message = $(“#txtEditor”).Editor(“getText”);

if(group < 1){
alert(“Select admin or moderator”);
return false;
}

if(users < 1){
alert(“Select users”);
return false;
}

if(!message){
alert(“Write a message”);
return false;
}

}

</script>

</head>
<body>

<form method=”post” action=”#”>
<input type=”checkbox” name=”group[]” value=”1″ />Admin<br />
<input type=”checkbox” name=”group[]” value=”2″ />Moderator<br />
<input type=”checkbox” id=”users” name=”users” value=”1″ />Users<br />

<textarea id=”txtEditor”></textarea>

<input type=”submit” onclick=”submit();return false;” value=” Submit “/>
</form>

</body>
</html>`

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@VITSUSASep 23.2019 — What is your goal behind this form? After that we can check your form accordingly.
Copy linkTweet thisAlerts:
@SempervivumSep 23.2019 — Do I understand correctly: You intend to check the user's input it it's complete and correct? Then make yourself familiar with HTML5 form validation:

https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Form_validation
Copy linkTweet thisAlerts:
@gecekuleauthorSep 23.2019 — @VITSUSA#1608986

send by ajax
Copy linkTweet thisAlerts:
@gecekuleauthorSep 23.2019 — @Sempervivum#1608998

Not user login

send mass messages to the members in the admin panel page

I have some options and I want to check them
Copy linkTweet thisAlerts:
@gecekuleauthorSep 23.2019 — Form check OK
``<i>
</i>function gonder() {
if($('input:checkbox').is(':checked') == false) {
alert();
}
if($('#uyeler').is(':checked') == true &amp;&amp; $('input[id=emailsec]:checked').length == false) {
alert();
}
if($("input[name='mesaj_basligi']").val().length &lt; 1) {
alert();
}
if(!$("#txtEditor").Editor("getText")) {
alert();
}
and ajax code
}

&lt;input type="submit" class="button" id="button-confirm" onclick="gonder();return false;" value=" Gönder "/&gt;<i>
</i>
``


But there is a problem

I use this editor: https://www.jqueryscript.net/text/Responsive-WYSIWYG-Text-Editor-with-jQuery-Bootstrap-LineControl-Editor.html

I write and send messages from the keyboard into the editor, There is no problem

When you copy a text from anywhere and paste it into the editor

When I click Submit, the form control does not work in javascript and ajax

refreshing page

What is the reason of this?
×

Success!

Help @gecekule spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...