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

can i refresh the page in javascript, or

Status
Not open for further replies.

andycape

Programmer
Joined
Aug 22, 2003
Messages
177
Location
ZA
can you think of another way to do this :

I have a selectbox, when i print it turns into a value (displays the selected value), after printing i want it to show the select box again. If i refresh the page (right click, refresh), it returns to the select box, but if i use window.refresh in the code at the end, it does nothing.

Here is my code :

<%Set RSC = MyClientsConn.Execute(&quot;SELECT * FROM Stores&quot;)
IF not RSC.EOF then
RSC.MoveFirst
do while Not RSC.eof %>
<option value=&quot;<%= RSC(&quot;Code&quot;)%>&quot;><%=RSC(&quot;Store&quot;)%></option>
<% End If
RSC.MoveNext
LOOP
END IF%>
</select></div></b>
</td>
</tr>
</table>

<script>
function PrintWin()
{
document.getElementById(&quot;sel&quot;).innerHTML= document.form.Company.options[document.form.Company.selectedIndex].value

window.print()
}
</script>
 
location.reload();

is the syntax for refreshing the page.


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
in your select tag put a class of 'HideForPrinting'

then create a style somewhere in the head section
<style media=print>
.HideForPrinting {display:none}
</style>

on error goto hell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top