X
X
xto_tbl_takou2017-11-28 18:10:56
MySQL
xto_tbl_takou, 2017-11-28 18:10:56

How to be in this situation with js html and php?

There is a file with the technical name "add.php" inside the code starts with <? and ends with ?> .
Within these <? ?> "parenthesis" has the following lines

<TR class=row2><TD>Тема объявления:<FONT color=#ff0000>*</FONT><BR>(не более $maxzag символов)</TD>
<TD><INPUT id=txtCommand name=zag class=maxiinput maxlength=$maxzag value=\"$zag\" placeholder='например, продам медикаменты...'></TD></TR>

- this is the first line, it works correctly with the script at the end of the page outside the <? ?>
Here's the second part of the code that doesn't work right below the first
<TR class=row1><TD>Текст объявления:<FONT color=#ff0000>*</FONT><br><br><br>Выделить текст:</TD>
<TD><TEXTAREA id=txtCommand class=maxiinput name=msg style='HEIGHT: 200px; WIDTH: 370px' id=messageFF required rows=5 placeholder='Текст объявления…'>$msg</TEXTAREA></TD></TR>

Script that works in the first part but does not work in the second
<script>
  var blackList = ['lorem', 'ipsum', 'dolor', 'sit', 'amet'];

  document.querySelector('input').onkeyup = function() {
      var expr = new RegExp(blackList.join('|'));
      if (this.value.search(expr) !== -1) {
      	this.value = '';
      }
  }
</script>

The task of the script is to delete the line entered by the user if it contains a word from the black list.
The question is, why does everything work in the first line, but not in the second?
And how to fix the second line to make it work?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
ThunderCat, 2019-09-12
@ThunderCat

Need to get resources_id, resources_name,
All or according to some criteria?
select 
`resources_id`,
`resources_name` 
from `resources`

select 
count(*) 
from `statistics` 
where `statistics_url` = '/resource/resources_id'

Requests are correct. Or are there other conditions?

S
Sergey c0re, 2019-09-13
@erge

select r.resources_id, r.resources_name, count(s.statistics_url)
  from resources r
  left join statistics s on s.statistics_url = concat ('/resource/', r.resources_id)
  group by r.resources_id, r.resources_name

A
archelon, 2017-11-28
@xto_tbl_takou

in the first part - input, and in the second - textarea, the script works with input.
---
rewrite JS: where you have , try replacing withquerySelector('input')querySelector('textarea')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question