Reputation: 13682
How can I allow user input on a page to change the HTML or CSS or anything. Is there a technique for this? I.e. If it is client-side web design, how can I have input from a form moved to a certain page and displayed to replace previous content. Let's say there is a main page with four links: Home, About, Links, Contact. In the admin-edit page, there is a form to enter, edit, delete links. Would I need a SQL database with the links' values that would populate this page and the other? Is there a better way to do this?
Upvotes: 1
Views: 458
Reputation: 1126
You want to change values in the "first" page in realtime using "second" page?
You can do this with javascript, given that the "second" page is opened by the "first" page using window.open('second.html','second_page')
Then in the "second" page, you can manipulate the "first" page by using something like opener.getElementById('someDiv').innerHTML = 'some text here';
Upvotes: 1
Reputation: 2860
What you are looking for is javascript I believe. You can use any amount of Javascript or Jquery ( A javascript library) in order to do various things on a page after it has been loaded. In Jquery you attach "Listners" to divs and spans and whatever HTML elements you want that react in different ways such as the mouse hovering over, clicks, and such.
You can find the API for jquery here: http://jquery.com/
If you want to make permanent changes to some setting and such then yes you would need PHP along with a SQL database in order to store the results. You would have to make panels for adding things to the database, editing, and retrieving them by using SQL insert, update, and select statements. You can read a bunch on how these things work at http://www.w3schools.com/ Good luck :)
Upvotes: 2