Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Refreshing a single tag (HTML/Javascript question)
#7
butterfli Wrote:Yeah, that's exactly what I'm trying to do. I actually have two functions working on the <select> tag. One is a .sort() function which sorts that given list by value. But once it's sorted, I can't "unsort" it so I'm trying to refresh it... a different method of "unsorting" it.
Ah. (I just lost the game.)

A... kind of iffy way of accomplishing that would be something like the following:

Code:
<script language="JavaScript">
function loadThis() {
var loadThis = document.getElementById('lol');
var inner = '<option value="1">a';
inner += '<option value="2">b';
inner += '<option value="3">c';
loadThis.innerHTML = inner;
}
</script>

...

<body onLoad = "loadThis()">

...

<form action="#">
<select name=lol id=lol size=5 onLoad = "javascript:loadThis()"></select>

<br>
<INPUT TYPE="button" value="Reload" onClick="javascript:loadThis()">

Basically just create the option tags in JavaScript, and do it again each time you hit the button.

I guess if you actually wanted to refresh it, you could do frames or something. Messy.

Devil Wrote:I dont think html / js can dynamically reload or update a page (or a form) without reloading it completly...
It can, and it's called AJAX. I don't think it's necessary for this, though.
Reply


Messages In This Thread
Refreshing a single tag (HTML/Javascript question) - by Russt - 2009-05-17, 08:30 PM

Forum Jump:


Users browsing this thread: