• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

calling javascript within php

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

good morning to you all and Thanks for your quick responses.. I have to call javascript function within PHP.. my requirement is div "err1" should be displayed in the below mentoined else block.. but, it did not display..


My PHP codings are



my javascript codings are



please rectify my mistakes.. Thanks in advance..


Regards,
Bala
 
Ranch Hand
Posts: 71
PHP Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"javascript" should be one word not two (in your PHP code, the <script> block)
 
bala kan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Hi Nick, after removing the space between "java script"in <script> block.. it doesn't work..

rectify me

Thanks in advance



Regards,
bala
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check whether there are any error JavaScript errors in the browser's error console.
 
Nick Charles
Ranch Hand
Posts: 71
PHP Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would also check the HTML source withon the browser to make sure that the script appears where you think it should.
 
bala kan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nick,

Good morning to you, HTML codings are


<form action="#" method="post">
<img src="images/text1.gif" alt="" width="56" height="11" />
<input type="text" class="input" name="username" />
<img src="images/text2.gif" alt="" width="56" height="11" />
<input type="text" class="input" name="password"/><br />
<input type="submit" class="button" value="Enter" /><br>
<div id="err1" style="display:none;"></div>

this div will be hidden by default.. and it should be showed when the given login id and password do not match


<!--<input type="button" class="button" value="Enter" /><br />-->
<input type="checkbox" class="checkbox" /><img src="images/text3.gif" alt="" width="70" height="13" /><br />
</form>



But, it gives me the problem.. Help me..

Thanks in Advance..


Regards,

Bala


 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Check whether there are any error JavaScript errors in the browser's error console.

 
Nick Charles
Ranch Hand
Posts: 71
PHP Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's the entire HTML source? I don't see any <script> tags. Scripts that don't exist can't be run.
 
bala kan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nick,


Good Morning to you,


My PHP Codings are








My Html codings are:

<form action="#" method="post">
<img src="images/text1.gif" alt="" width="56" height="11" />
<input type="text" class="input" name="username" />
<img src="images/text2.gif" alt="" width="56" height="11" />
<input type="text" class="input" name="password"/><br />
<input type="submit" class="button" value="Enter" /><br>
<div id="err1" style="display:none;"></div>

this div will be hidden by default.. and it should be showed when the given login id and password do not match


<!--<input type="button" class="button" value="Enter" /><br />-->
<input type="checkbox" class="checkbox" /><img src="images/text3.gif" alt="" width="70" height="13" /><br />
</form>
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Nick noted

should be
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic