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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Values between DIV containers

Status
Not open for further replies.
Jun 14, 2008
16
US
Hi there...

I have a simple Tabbed Menu on my webpage. Each of the tabs when clicked, takes me to a div container with a form inside it. Each of the div tags has a Previous and Next to navigate between tabs. On the first tab, I enter values for firstname and lastname and then hit Next which takes me to the 2nd tab. Now my question is, how do I retrive the firstname and lastname values to show on my 2nd tab?

Heres the code:

//Tabs
<ul id="tablist">
<li><A id="addinfo" onclick="return expandcontent('div1', this)" href ="new.htm">1st Tab</A>
<li><A id="verf" onclick="return expandcontent('div2', this)" href ="hot.htm">2nd Tab</A></li>
</ul>

//DIV1
<div id="div1" class="tabcontent">
<table border=0 width="100%">
<form name=div2>
<tr>
<td<LABEL>Last Name:</LABEL></td>
<td><INPUT id=lastname name=lastname ></td>
</tr>
<tr>
<td><a href="#" align="right" class="footer1" onClick="test(document.div2.firstname.value);">NEXT</a></td>
</tr>
</table>
</form>
</div>

//DIV2
<div id="div2" class="tabcontent">
<table border=0 width="100%">
<tr>
<td><LABEL>Last Name:</LABEL></td>
<td><INPUT id=lastname name=lastname >SHUD SHOW THE VALUE ENTERED IN TAB1-something like document.div2.firstname.value</td>
</tr>
</table>
</div>
</tr>

//TEST JAVASCRIPT
<script language=JavaScript>
function test(firstname)
{
alert(firstname);
return addinfo.click(firstname);
}
</script>
 
This is a ASP forum and I don't see any ASP in the above code.

The way you have it set up, it looks more like it wants to be an AJAX question.

If you want to use ASP you might try using your scripting to set a session variable and retrieve that.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top