Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a value in a html file

Status
Not open for further replies.

Coogan

Programmer
Jun 21, 2004
38
GB
Hi Guys,

I have asked this question in the PHP forum and been directed here.

I am trying to find out if it is possible to change a line of html code in another webpage by clicking a button.

Basically I want to change a value on index.htm when i cilck a button on admin.htm

The value that I would want to change would be between a <div> tag and the <div> would have a unique id.

Is this possible? If so can someone please point me in the right direction.

Thanks

Martin
 
You cannot use Javascript to modify the actual page source if that was what you were hoping. You could use ActiveX to do that though - on IE for Windows (only).

I'm picking you have both pages open at the same time (in the same browser, in their own windows). If this is true, then you could do a loop through the window array to find an open window with a div of a known id. Once you have the window, then you can get a reference to the div using getElementById("idGivenToDiv") and then you can set the innerHTML to that div to be soemthing new.

Do you maybe have them both open as different frames in the same window? Is one opened in an iframe within another? Do you have a server-side option available (asp, php, jsp etc)?

Let us know some more.

Cheers,
Jeff
 
I would be looking to permenantly change the actual page source.

The admin page would be the only page that would be open at the time of the change.

I looked at your posibility of using the innerhtml option whilst having the page open but when I closed the page and reopened it, it cleared the value.

I have the option of PHP and was thinking of the possibility of opening the file into an array and then altering the line of code and re-writing the file. But i dont know where to start.

Thanks for letting me know that this would not be possible through javascript though.

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top