i already added the javascript in PHP doc but its nt wrking

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
icesha
Forum Newbie
Posts: 11
Joined: Tue May 01, 2007 3:15 am

i already added the javascript in PHP doc but its nt wrking

Post by icesha »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


i already added the javascript in my page and i saved it as .PHP, but the messagebox that i created is not working. 
the code is like this

[syntax="html"]
[b]<script language="javascript" type="text/javascript">
function disp_alert()
  {
  alert("I am an alert!!");

  }
</script>[/b]</head>

<body>
<div class="style9" id="Layer17">
  <p>Direction:Identify the type of sentence according to structure of the sentences given below.</p>
  <p>1. Ottawa is the capital of Canada, but Toronto is the capital of Ontario.  </p>
  <form id="form1" name="form1" method="post" action="">
    <label>
    a.
    
    </label>
    [b]<input name="submit" type="submit" value="Simple Sentence" onlick="disp_alert()" />[/b]  </form>
  <p>&nbsp;  </p>
  <p> 
    <label></label><label></label>
  </p>
  <label></label>
</div>
in this code a button will trigger the event to display the msgbox. i've tried it in a simple php webpage it work but when i tried it in a much complicated one, its not working.
i dont know whats wrong.


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: i already added the javascript in PHP doc but its nt wrk

Post by superdezign »

icesha wrote:

Code: Select all

<input name="submit" type="submit" value="Simple Sentence" onlick="disp_alert()" />
... onlick? That's a new one.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

:lol: That's my all time most frequent error when typing event handler names in HTML.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

d11wtq wrote::lol: That's my all time most frequent error when typing event handler names in HTML.
Well as long as it remains an invalid event, I can feel safe when I'm around my computer.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

One day we'll be able to use onLick(). Monitors will have "taste-o-vision", and we'll be able to lick the screen to taste things before buying them, it'll be a boon to online grocery shopping.

And porn.

:twisted:
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

onion2k wrote:One day we'll be able to use onLick(). Monitors will have "taste-o-vision", and we'll be able to lick the screen to taste things before buying them, it'll be a boon to online grocery shopping.

And porn.

:twisted:
8O
Time to turn on SafeSearch filtering for Google Images.
Post Reply