change text in input box - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

change text in input box

sharingansharingan Posts: 15Member
hello

im new in php codes
i just wanna ask if someone know how to change the text inside the input box?

for an example:
if user insert text in the input box
the input box view the text type=arial & text size=1

can I do that?

Comments

  • AgbagbaraAgbagbara Posts: 24Member
    : hello
    :
    : im new in php codes
    : i just wanna ask if someone know how to change the text inside the input box?
    :
    : for an example:
    : if user insert text in the input box
    : the input box view the text type=arial & text size=1
    :
    : can I do that?
    :

    Hi

    You could change the text in the box, if you resubmit the page or by using javascript.

    You would have to implement a function of one of the possible events associated with textboxes.

    like onChange or onBlur = "doChanges(this)"

    If you can explain what you want I could tell you how.

    Omo
  • mac_doggiemac_doggie Posts: 488Member
    I think you mean you want to change the styles of the input box...?

    You should do that with CSS. If you start with webprogramming you should know that there are three different sections you have to take care of.

    The first is the server side language. If you have a simple static site you won't be needing it, but since you are on the php board here I figure you are using PHP as server side script. In this section the HTML page is build, you can merge it with data from your database or files on your server. All is merged to one file wich is spit out by the server and sent to the client (the browser)

    The second is the clientside HTML/Javascript This takes place in the browser. The HTML is used to markup the page and divide it into manageble portions (containers) these containers can be pimped with CSS in the third section.

    The third section is the CSS (Cascading stylesheet) Your HTML get's it lookes here. THe containers get backgroundcolors, borders, background images, margins, paddings etc... Containers can be repositioned etc.


    So to come back to your question... You don't change the looks of an input tag with php, you use CSS to do that.

    include a css file in the head of your html page:
    [code]

    [/code]
    or use an inline stylesheet
    [code]



    [/code]
    or really do it crappy with inline styles...
    [code]

    [/code]

    You'd best use a combination. Styles that are used in the whole site go in the stylesheet, styles that are only relevant to this single page can go in a style tag, and styles that are only relevant for one element go inline. (Best minimize this last one, and maximize the first one)

    to set the styles for you input tags :
    [code]
    input {
    font-family : Verdana, Helvetica, Sans-serife;
    font-size : 80%;
    }
    [/code]

    If you want to change only some textboxes use classes and id's
    [code]
    .redBackground {
    background-color : #FF0000;
    }
    .greenBackground {
    background-color : #00FF00;
    }
    [/code]
    [code]


    [/code]

    hope you now understand enough to really get into webprogramming...

    : : hello
    : :
    : : im new in php codes
    : : i just wanna ask if someone know how to change the text inside the input box?
    : :
    : : for an example:
    : : if user insert text in the input box
    : : the input box view the text type=arial & text size=1
    : :
    : : can I do that?
    : :
    :
    : Hi
    :
    : You could change the text in the box, if you resubmit the page or by using javascript.
    :
    : You would have to implement a function of one of the possible events associated with textboxes.
    :
    : like onChange or onBlur = "doChanges(this)"
    :
    : If you can explain what you want I could tell you how.
    :
    : Omo
    :

    ;-)
    -mac-
    mailto:[email protected]
    the Netherlands...


Sign In or Register to comment.