SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2003
    0 Post(s)
    0 Thread(s)

    Help with piece of code

    In the following piece of code my browser things the less than symbol is an opening html tag. Does anyone Know why this is?. Also I want this script to return false if a user enters a character instead of an int. How do I do this?

    <script language="javascript">
    function Verify() {

    if ( <= 0 || =="")

    alert("Either you have not requested any tickets, or have entered a 0.");
    return false;

    else {;
    return true;

  2. #2
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Wellington, New Zealand
    0 Post(s)
    0 Thread(s)
    if you surround you javascript with html comments and surround the html comment with javascript comments as follows (although you shouldn't have to do this unless you have an old browser):
    <script><!-- // Loads the frame if someone loads this instead.
    if(parent.location.href == self.location.href) { window.location.href = 'index.html'; }
    you can try using the parseInt() function to see if the value entered is what you want.
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts