Jump to content
Sign in to follow this  
jkSandy

Input field question

Recommended Posts

I am using input fields to display/change data from a database. So the user can display a record and change a field value then update the DB record. When the DB field contains text such as: “Intro to Logic” only “Intro” displays in the (input) field. If the field contains “Intorto Logic” only “Introto” displays in the (input field). In ohter word it stops at the first space. I am using a variable to place the text into the value attribute of the input field: value=<?php echo $_SESSION[className] ?>. Yet when I put the literal value=“Intro to Logic” it displays the entire phrase – “Intro to Logic”. What am I doing wrong or what am I misunderstanding about input fields. Note: if I display the text outside an input object it displays correctly so information is passing correctly from the database to the web page.

Share this post


Link to post
Share on other sites

Is there quotes around the statement of the value attribute? I dont know much about php, but i think quotes are needed.value="<?php echo _SECTION[className]?>"

Edited by eTianbun
  • Like 2

Share this post


Link to post
Share on other sites

I've not been working with database involvement yet, but that issue could be a FAQ .. so I'm thanking both of you for it honestly

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...