Page 1 of 1

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

Posted: Mon Jul 30, 2007 10:29 am
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]

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

Posted: Mon Jul 30, 2007 10:34 am
by superdezign
icesha wrote:

Code: Select all

<input name="submit" type="submit" value="Simple Sentence" onlick="disp_alert()" />
... onlick? That's a new one.

Posted: Mon Jul 30, 2007 10:50 am
by Chris Corbyn
:lol: That's my all time most frequent error when typing event handler names in HTML.

Posted: Mon Jul 30, 2007 11:23 am
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.

Posted: Mon Jul 30, 2007 11:39 am
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:

Posted: Mon Jul 30, 2007 11:59 am
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.