aspose file tools*
The moose likes PHP and the fly likes calling javascript within php Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » PHP
Bookmark "calling javascript within php" Watch "calling javascript within php" New topic
Author

calling javascript within php

bala kan
Ranch Hand

Joined: Aug 20, 2012
Posts: 44
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
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 71

"javascript" should be one word not two (in your PHP code, the <script> block)
bala kan
Ranch Hand

Joined: Aug 20, 2012
Posts: 44


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

rectify me

Thanks in advance



Regards,
bala
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41800
    
  62
Check whether there are any error JavaScript errors in the browser's error console.


Ping & DNS - my free Android networking tools app
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 71

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

Joined: Aug 20, 2012
Posts: 44
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
Marshal

Joined: Mar 22, 2005
Posts: 41800
    
  62
Ulf Dittmer wrote:Check whether there are any error JavaScript errors in the browser's error console.
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 71

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

Joined: Aug 20, 2012
Posts: 44
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>
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30506
    
150

As Nick noted

should be


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling javascript within php