Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Value from DIV TAB id to dropdown Onchange Event

Status
Not open for further replies.

MayoorPatel

Programmer
Apr 10, 2006
35
GB
Hi there I have a dropdown

Code:
<select name="OrganisationID" size="1" class="text300" 
	                     onChange="javascript:document.forms[0].submit();">

and a set of div tabs.

Code:
<td id="cardActivitySchemeTab" class="selectedTab" onclick="setFormAction(this.id);moveTabSectorSkillsReports(this.id, 'cardActivityScheme');">Card Activity by Scheme</td>
						    <td id="allNewCardsTab" class="tab" onclick="setFormAction(this.id);moveTabSectorSkillsReports(this.id, 'allNewCards');">All New Cards</td>													
						    <td id="cardsIssuedTab" class="tab" onclick="setFormAction(this.id); moveTabSectorSkillsReports(this.id, 'cardsIssued');">Cards Issued</td>													
						    <td id="verifierActivityTab" class="tab" onclick="setFormAction(this.id); moveTabSectorSkillsReports(this.id, 'verifierActivity')">Verifier Activity</td>													
						    <td id="detailedVerifierActivityTab" class="tab" onclick="setFormAction(this.id); moveTabSectorSkillsReports(this.id, 'detailedVerifierActivity');">Verifier Activity (Detailed)</td>

What I need to do is when the dropdown value is changed I need whatever DIV tab is active to be passed to the function (ExecuteMail(Currenttab)) in the dropdown onchange command.

Code:
<select name="OrganisationID" size="1" class="text300" 
	                     onChange="ExecuteMail(Currenttab);javascript:document.forms[0].submit();">

Is there any way of doing this?

Mayoor
 
I would suggest that you use a global variable to store the selected tab. You can access it from any function within the page - and could even then store it in a cookie and retrieve it through page traversal as well!

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top