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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.