Click to See Complete Forum and Search --> : html replacement from body


ohgodimlame
01-10-2006, 03:10 AM
not sure if this is possible but lets find out

with out changing anything in the head

i would like to change the html inside the span

<head>
cant touch anything in here
</head>
<body>
<span class="changeme">
<input blah blah blah blah>
<input blah blah blah blah>
</span>

!!!! insert code here !!!!!!

</body>

removing the input tags completely and inserting <b>sorry disabled</b> instead

thanks

bathurst_guy
01-10-2006, 05:45 AM
I guess you are wanting this to be an immediate thing that happens on the page without the page reloading, in which case you will need to use javascript.
You could do this:<html>
<head>
</head>
<body>
<span id="changeme">
<input blah blah blah blah>
<input blah blah blah blah>
</span>

<a href="#" onClick="document.getElementById('changeme').innerHTML = '<p>sorry disabled</p>';return false;">disable</a>
</body>
</html>

ohgodimlame
01-10-2006, 07:58 AM
thanks for the quick reply but there are a few things that i cant have with that example

1. i cant change the class to an id
2. i want it to load with the page
3. i want it to be invisible

the idea is to disable the inputs on the page so people will not click on them and it looks clean and unnoticable

i was using this

<style type="text/css">
.changeme input {display: none;}
</style>

but i want to put something in its place

edit:

actually since the input fields are like this

<input name="Rating" type="radio" value="1" onclick="javascript:form.submit();">
<input name="Rating" type="radio" value="2" onclick="javascript:form.submit();">

changing all the values to 0 would be extremely helpful

Charles
01-10-2006, 08:15 AM
<script type="text/javascript">
if (document.getElementsByTagName) {
e, i = 0
while (e = document.getElementsByTagName ('BODY')[0].getElementsBytagName ('*')[i++]) {if e.className.toLowerCase() == 'changeme') e.style.display = 'none'}
}
</script>

ohgodimlame
01-10-2006, 08:35 AM
i just realized that i used the same class later on in the page so i am going to have to do it to make the values of the inputs change instead of changing the html inside of the span

sorry

COULD SOME ONE LOCK THIS IM GOING TO START A NEW THREAD WITH A BETTER TITLE