Re: JS prompt -> php [become 0T]

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

 



Ryan A wrote:
> Hey Colin,
> Thanks for replying.
> 
> I guess this has sidelined from php a bit now... so have added a OT in the subject line.
> 
> Anyway, this is how I get the values from a select or a text box:
> 
> var selectBox = document.forms[0].lang;        user_input = selectBox.options[selectBox.selectedIndex].value;
>     var textBox   = document.forms[0].sec_name;    user_section = textBox.value;
> 
> kindly show me how to get the value from a javascript prompt box, 
> the force is with me but the JS DOM is from the dark side :D


I think you just do 'var value = prompt("Give Me a Value:", "Value");'

Also, it is generally more portable to give any element that you wish to
access an id attribute in HTML and use the
document.getElementById('myid') method. This is the preferred method
(and infact libraries like prototype will give you even nicer functions
like $('myid') to do this).

PS this is is not yet touching on DOM methods ;)

Col

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux