I have a webpage where the user fills out fields and then clicks on Submit, which writes all the information to a MySQL database using Ajax and then continues to another page where they can see the information they just sumbitted and then click on PayPal button to make payment. My question is two part: Using Javascript, can I reload the exact same page in the same format with all the same information but in read-only instead of input and with a PayPal button instead of the Submit Button and how is the best way to go about this OR can I have the page change the Submit Button to the PayPal button using Javascript and leave the rest of the page alone or even change all the input fields to read only? I am teaching myself most of what I am writing in these web pages, so I have a lot to learn.
Load duplicate page with same data?
Collapse
X
-
after the successful execution of the AJAX-call you might set the readonly attribute to the input nodes and remove/hide the submit button while adding/unhide the paypal buton ... you just need to retrieve the corresponding DOM-nodes with:
for example. or set the disabled attribute in this way. to hide something you might use a similar call:Code:document.getElementById('theId').readonly = 'readonly';
kind regardsCode:document.getElementById('theId').style.display = 'none';
Comment