javascript - Java script doesn't run inside the html file in ionic frame -


i have form used users input. want js run in header check validation.

my html code:

<ion-view view-title="{{chat.name}}">   <ion-content class="padding">           <head>     <meta charset="utf-8">      <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/pepper-grinder/jquery-ui.css" media="screen" rel="stylesheet" type="text/css">       <script>         function validateform(objform) {          if (objform.make.selectedindex == 0) {         alert("please select request");         returnstatus = 0;         };          var x = document.forms["request"]["description"].value;         if (x == null || x == "") {         alert("please fill out description");         return false;         }     }  </script>  </head> <body> <h2>service request</h2> <br></br>     <div id="container">          <form action="" method="post" id="customtheme" name ="request">             <p>                 <label for="requesttype" style="padding-right:56px">request type:</label>                      <select name="make" id="request">                         <option value="0">--please select--</option>                         <option value="1">car pass ticket</option>                      </select>                 </p>              <p>                 <label for="description" style="padding-right:56px" style="vertical-align: top;">description:</label>                 <textarea name="description" id="description" cols="10" rows="6" required></textarea>             </p>              <p>                 <input type="button" value="submit" name="submit" style="align:center" id="submitbutton" onclick="validateform(document.request)"/>             </p>         </form>     </div> </body>    </ion-content> </ion-view> 

i have java script in header doesn't executed. can done fix error or other way can validation.

put in controller. why have there?

the <ion-view> injected <ion-nav-view> sugar on ui-router's <ui-view>.

why have head, body etc inside ion-view?

go through angular docs , ionic docs. jquery approach wont work. , remove jq-ui.css. have ionic, ui framework.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -