Jump to content

Content Loader


Canman2005

Recommended Posts

Hi all

 

I have the following code

 

<select name="items[]" onChange="scriptloader(content.php?thisid='+this.value,'loadingarea');">
<option value="23">Apple</option>
<option value="11">Microsoft</option>
<option value="4">Google</option>
</select>
<span id="loadingarea"></span>

 

Basically when something is selected from the drop down list, it passes the selected value through to a script and loads it within the "loadingarea" SPAN tags.

 

So for example, if Microsoft is selected, then it loads the URL

 

content.php?thisid=11

 

Into the "loadingarea" SPAN tags.

 

This all works fine.

 

My problem is that I have lots of the above code on one page, so my page can look like

 

<select name="items[]" onChange="scriptloader(content.php?thisid='+this.value,'loadingarea');">
<option value="23">Apple</option>
<option value="11">Microsoft</option>
<option value="4">Google</option>
</select>
<span id="loadingarea"></span>

<select name="items[]" onChange="scriptloader(content.php?thisid='+this.value,'loadingarea');">
<option value="23">Apple</option>
<option value="11">Microsoft</option>
<option value="4">Google</option>
</select>
<span id="loadingarea"></span>

<select name="items[]" onChange="scriptloader(content.php?thisid='+this.value,'loadingarea');">
<option value="23">Apple</option>
<option value="11">Microsoft</option>
<option value="4">Google</option>
</select>
<span id="loadingarea"></span>

 

Basically I have a script to duplicate the block of code, so that multiple drop downs can be added to the same page.

 

The problem is, that because I sometimes have multiples of this block of this code, when I select something from the 2nd or 3rd drop down list, it loads their URL into the 1st "loadingarea" SPAN tag.

 

Is there a way to tell

 

scriptloader(content.php?thisid='+this.value,'loadingarea')

 

that it should be loading its content into the SPAN tag below the drop down that is currently being selected from?

 

If that makes any sense

 

Been trying different options all day, and cannot find a solution.

 

Please help :(

 

Thanks all

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/202651-content-loader/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.