I wanted to set the value of a textbox to be the username of whoever is logged into my application.
In the login page, a session variable username was set to be the username of whoever successfully logged in.
On the form itself i have a text box called operators that would show this username but i am running into some trouble. A username is the persons name in common and Capital letters as follows eg. John Smith's username would be JohnSmith
However, In the textbox i want to see John Smith as the value
This is where my javascript opname() function comes in. It parses the username and adds a space.
what i have so far is as follows (So wrong)
Expand|Select|Wrap|Line Numbers
- <input type="text" name="operators" id="operators" size="40" <? if (isset($_SESSION['username']))?> value="return opname("<? $_SESSION['username'] ?> ");" />
The opname javascript code is working ,....I just dont know how to call it within the Value attribute
Can someone please help me