Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: php code within value

  1. #11
    Join Date
    Jan 2012
    Location
    London, United Kingdom
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Static means "constant - never changing".
    Dynamic is can be changed.

    By hardcoding a static value like value="somevalue". The value will always be "somevalue". Where as using a language like PHP and setting the value to a variable (vary-able - the value can vary) you can have the value change depending on different conditions.

    example.
    Code:
    if($day == 'monday') $somevariable =  'Today is Monday';
    else $somevariable = 'Today is not Monday';
    echo $somevariable;
    lets say we have a variable called $day which returns the current day. If the value of $somevariable is monday, the above script will print 'Today is Monday' - If it is not Monday the above script will print out 'Today is not Monday'.
    This is how we work dynamicaly. I hope that clears that up, if not i'll be happy to explain in yet more detail at a later time.

    What you're refering to about popups and stuff sounds like the HTML attribute title="some title" <- Thus will give a sort of popup when hovered over saying some title. value="some value" has nothing to do with popups, but sets the default value of an element. Ever loaded a form up where some of the fields are already filled out? Edited a comment on here? The value attribute is what is used to preload the input value of the given field in the form. It's loaded dynamicaly from a database and stored in a variable. Similar to $eid.

  2. #12
    Join Date
    Jul 2011
    Posts
    58
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Ya thats what I am saying .
    SAy you have text box called empid ,then what is the utility
    of having filled a textbox with value (variable or static) when u r going to overwrite it everytime with some other value?
    I mean ,maybe i am not clear yet with basic html,but what is the use?
    you people are not getting my point at all!!
    A value already filled inside a blank text box is of no use,coz ultimately you have to type something inside it a textbox and then u click submit button.
    I cant get why u fill textbox with some value

  3. #13
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    If you want a default value for the textbox.

    For example:

    1. The user filled out the form, but had one error. You can leave the correct values, so they don't have to fill out the entire form again.

    2. You are retrieving a database record and putting the values into the form so they can be edited. (I would imagine that this is what is going on in your original post.)

    ... lots of other possibilities. everyone's trying to help you here; just take a moment to clarify what it is you actually want to know.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •