SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: if statement in onclick event

Threaded View

  1. #1
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    if statement in onclick event

    It always says "nothing in text box"

    PHP Code:
    <input type="text" class="formSmallTextbox" name="a_number" size="4" value="<?="$a_number"?>">
    PHP Code:
    <input type="submit" name="submit" class="formTextbox" value="Submit" onClick="<?php
        
    if ($a_number >= '1'){
        echo 
    "return confirm('something in text box')\">";}                else{
        echo 
    "return confirm('nothing in text box')\">";}
        
    ?>
    Last edited by matthewst; Jun 11, 2007 at 09:06.

Bookmarks

Posting Permissions

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