Jump to content

How do I change the value property of a text box with Javascript?


DeX

Recommended Posts

This should be very simple I know but here is why it doesn't work for me.

I have a purchase order displaying on the screen and I give my client the option to edit some of the fields before:

a) the purchase order HTML gets sent to a PDF generator on the server to auto create and save it in PDF format.

b) the purchase order HTML is also sent to the database to be saved in case they want to bring it up in the future and edit it again and re-save.

 

Regardless of all that, I have the purchase order HTML on the screen with input (text) boxes around fields they can edit. When they edit the field and the HTML is sent to the database to be saved for later, the actual value property of the input element hasn't changed. So loading it up later shows the old value, not the one the client entered. So I tried to assign the .value property of the input element in Javascript prior to saving it to the database and it does indeed change the value visible inside the text box to whatever I have it set at but it doesn't actually change the .value property of the element. If I do an "inspect element" in Chrome, I can see the .value property hasn't changed from the original value. So how can I change the actual .value property associated with the element so that it displays with the new value when I pull the HTML code back out of the database for later use?

 

Or any other suggestions welcome as well, thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.