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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.