Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140161

Why am i getting a "function not defined" error when there are 2 functions in the script tag?

$
0
0

The script tag part in "head" : '''

  function reload()
  {
     //some code


  }
  function bookconfirm(clickinfo)
  {
        //some code
  }

The part that are calling them:

<select name="city" onchange="reload()">

          <td><button type="button" onclick="bookconfirm(<?php echo $c;?>)">Book</button></td>

Errors:

             Uncaught ReferenceError: reload is not defined at HTMLSelectElement.onchange


        Uncaught ReferenceError: bookconfirm is not defined  at HTMLButtonElement.onclick 

I'm probably unable to understand how functions work in js or something , thanks for your time and knowledge.


Viewing all articles
Browse latest Browse all 140161

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>