Re: Javascript + php problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I want to after I make an if(.) if it's true call a javascript
> function, but it doesn't work, here is the code
>

Just a obvius note, but as you don't sent all code, we can only guess.

Remember that you can not call a javascript function from PHP. You can
only put Javascript code that is executed when the page (PHP result) is
loaded.

Normally, I put this kind of code, in a funcion called in the "onLoad"
event of the page; to assure the page is loaded, and the form is correctly
displayed.

I suposse your code may be actually working, but just before the form be
active.

And as my personal prefered choice, you can replace your javascript code,
for a simple line on your form:

<input type='text' name='int_amount' <?php
  if ( ($this_user != $my_user)||($this_pass != $my_pass)  )
    echo " READONLY";
?>>

-- 
José Miguel Santibáñez
    jms@xxxxxxxxx

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux