Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
html pattern onclick js
#3
(29.05.2022, 19:37)admin schrieb: Was meinst du mit , das es niocht bei js übernommen wird ? Die aussage verstehe ich nicht ganz

hier mein alter HTML code um das modal zu öffnen (<form method="post">)
Code:
<div class="modal" id="myModal4">
  <div class="modal-dialog modal-lg">
   <div class="modal-content">
     
    <div class="modal-header">
     <h4>monitorOESoft - Alarmierungstool</h4>
       </div>
        <div class="modal-body">
         <h5 style="margin: 10px"; class="m-0">Radio Identification Code</h5>
          <form method="post">
           <input type="text" class="form-control" placeholder="Rufadresse" name="address" style="height: 33px; width: 150px; border-color: black; margin-left: 15px" maxlength="7"  required="required" pattern=".{7}">
            <br>
           <input type="text" class="form-control" placeholder="Subadresse" name="funktion" style="height: 33px; width: 150px; border-color: black; margin-left: 15px" maxlength="1"  required="required" pattern=".{1}">
          <p style="margin: 15px"; class="m-0"><font size="1">(a)= Einsatzalarm (b)= Bagatellalarm (c)= Infoalarm (d)= Rückalarm</font></p>
          <textarea type='text' name="memo" cols="60" rows="5" placeholder="Freitext" class="form-control" style="height: 125px; width: 600px; border-color: black; margin-left: 15px"></textarea>   
        </div>
        
        <div class="modal-footer"> 
          <input type="Submit" name="send_pocsag" class="btn btn-default" value="Senden"> 
          <input type="Submit"  class="btn btn-default" value="Abbruch" data-dismiss="modal">
         </form>
        </div>
      </div>
    </div>
  </div>
 
hier mein neuer code um das modal zu öffnen (mit javascript)
die attribute von html (maxlength="7" required="required" pattern=".{7}") werden nicht berücksichtig??? warum?

Code:
onclick="test()"

Code:
function test() {    
var address = document.getElementById('address').value+document.getElementById('subaddress').value;
    dataString = 'send_pocsag='+address;
    $.ajax({
        type: 'POST',
        url: 'monitorOESoft.php',
        data: dataString,    
        success: function(response){
             if(response==3822){
            $('#myModal4').modal('hide');    
            $('#address').val('');
            $('#subaddress').val('');        
    }
   }    
  });
}


Code:
<!-- Modal Alarm senden -->
<div class="modal" id="myModal4" data-backdrop="static">
  <div class="modal-dialog modal-lg">
   <div class="modal-content">
    <!-- Modal Header -->
    <div class="modal-header">
     <h4>monitorOESoft - Mobile Alarmierung</h4>
       </div>
        <div class="modal-body">
         <h5 style="margin: 15px; color: blue"; class="m-0">Radio Identification Code</h5>
         
           <input type="text" class="form-control" placeholder="Adresse des Funkrufempfängers" id="address" style="height: 33px; width: 300px; border-color: black; margin-left: 15px" maxlength="7"  required="required" pattern=".{7}">
           <p style="margin-left: 15px; color: blue">Test RIC 1234566</p>
            <br>
           <input type="text" class="form-control" placeholder="Subadresse" id="subaddress" style="height: 33px; width: 300px; border-color: black; margin-left: 15px" maxlength="1"  required="required" pattern=".{1}">
          <p style="margin-left: 15px; color: blue">(a)= Einsatzalarm (b)= Bagatellalarm (c)= Infoalarm (d)= Rückalarm</p>
          <textarea type='text' id="memo" cols="60" rows="5" placeholder="Freitext" class="form-control" required="required" style="height: 125px; width: 600px; border-color: black; margin-left: 15px"></textarea>   
         </div>
        <!-- Modal footer -->
         <div class="modal-footer"> 
          <input type="Submit" onclick="test()" class="btn btn-default" value="Senden"> 
          <input type="Submit" class="btn btn-default" value="Abbruch" data-dismiss="modal">
        
        </div>
      </div>
    </div>
  </div>
Zitieren


Nachrichten in diesem Thema
html pattern onclick js - von black79 - 29.05.2022, 09:23
RE: html pattern onclick js - von admin - 29.05.2022, 19:37
RE: html pattern onclick js - von black79 - 31.05.2022, 09:06
RE: html pattern onclick js - von admin - 01.06.2022, 22:37
RE: html pattern onclick js - von black79 - 02.06.2022, 05:48
RE: html pattern onclick js - von admin - 31.05.2022, 18:04
RE: html pattern onclick js - von black79 - 01.06.2022, 09:13
RE: html pattern onclick js - von admin - 02.06.2022, 23:04
RE: html pattern onclick js - von black79 - 04.06.2022, 14:02

Gehe zu:


Benutzer, die gerade dieses Thema anschauen:
1 Gast/Gäste