how to retrieve a dom from innerHTML......

how to retrieve a dom from innerHTML......

am 20.01.2010 05:36:10 von michael3832628

--0016e64cce942b99ae047d91206d
Content-Type: text/plain; charset=ISO-8859-1

hello, i can obnot retrieve a select ject from div innerHTML.
what i want to do is that when a page is loaded, first selector,say #1,
would be shown in the first div by sending a request.then i choose one
option from #1, fire change event of #1, the second selector #2 will be
shown in div two, then choose option from #2 .............blabla..

but the problem is when selector #1 was loaded, the object #1 could not be
obtained.
codes:

window.addEvent('domready', function() {

var option=1;

var result = new Request({
url:'getInfo_gx.php'
,
method:'get',
onSuccess:function(response)
{
if(option==1) $('list_sch').innerHTML = response; //response =
" value='123'>123312";


if($('sch_list')) // heres the problem... object can not
be obtained.
{
$('sch_list').addEvent('change',function(){ // events
can not be fired
option=2;
result.send('type=2'+'&sch='+$('sch_list').value.replace('+' ,'%2B'));
});
}

});

--0016e64cce942b99ae047d91206d--

Re: how to retrieve a dom from innerHTML......

am 20.01.2010 10:23:38 von Pete Ford

I am on the top of the world! Borlange University wrote:
> hello, i can obnot retrieve a select ject from div innerHTML.
> what i want to do is that when a page is loaded, first selector,say #1,
> would be shown in the first div by sending a request.then i choose one
> option from #1, fire change event of #1, the second selector #2 will be
> shown in div two, then choose option from #2 .............blabla..
>
> but the problem is when selector #1 was loaded, the object #1 could not be
> obtained.
> codes:
>
> window.addEvent('domready', function() {
>
> var option=1;
>
> var result = new Request({
> url:'getInfo_gx.php'
> ,
> method:'get',
> onSuccess:function(response)
> {
> if(option==1) $('list_sch').innerHTML = response; //response =
> " > value='123'>123312";
>
>
> if($('sch_list')) // heres the problem... object can not
> be obtained.
> {
> $('sch_list').addEvent('change',function(){ // events
> can not be fired
> option=2;
> result.send('type=2'+'&sch='+$('sch_list').value.replace('+' ,'%2B'));
> });
> }
>
> });
>

You probably ought to ask a Javascript forum about javascript problems...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php