473,387 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Toggle text

Jon
I'm looking for a way to toggle text without using client scripting.
One way to go is by the visibility property and a click event, but this
does a postback and returns to the top of the page. Is there a way
around this?
Jon Cosby

Nov 19 '05 #1
4 1640
> I'm looking for a way to toggle text without using client scripting.
One way to go is by the visibility property and a click event, but this
does a postback and returns to the top of the page. Is there a way
around this?


Not without client scripting. And, unless you are using a form submit, the
click event will be client scripted anyways (to trigger the postback).

One option of the top of my head:

Don't use a postback, but instead querystrings, then add a dynamic redirect
pointing back to the page with an anchor link attached to the URL.

If you don't want to use javascript for the toggle, but are OK using it just
to scroll the page, then you can attach a javascript to the body tag onload
from the postback trigger's handler:

pageBody.Attributes.Add("onLoad", "location.href='#yourAnchor';")

-Darrel


Nov 19 '05 #2
no. if you want the server to do it, you need to postback. you could then
use client script to reposition the page, but then why not use client script
in the first place. you could try smart navigation (which is a client script
solution), but its IE only and has some issues.

-- bruce (sqlwork.com)

"Jon" <no****@jcosby.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I'm looking for a way to toggle text without using client scripting.
One way to go is by the visibility property and a click event, but this
does a postback and returns to the top of the page. Is there a way
around this?
Jon Cosby

Nov 19 '05 #3
If you do go the postback route and need a script to scroll back to your
original position, and don't want to use smart navigation I wrote a script
(ScrollToElement) that is in a javascript component available for free (with
full source code) on my website, www.aboutfortunate.com, I have tested it
with every browser I could think of (latest version of each only) and it
works everywhere.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bruce Barker" <br******************@safeco.com> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl...
no. if you want the server to do it, you need to postback. you could then
use client script to reposition the page, but then why not use client
script in the first place. you could try smart navigation (which is a
client script solution), but its IE only and has some issues.

-- bruce (sqlwork.com)

"Jon" <no****@jcosby.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I'm looking for a way to toggle text without using client scripting.
One way to go is by the visibility property and a click event, but this
does a postback and returns to the top of the page. Is there a way
around this?
Jon Cosby


Nov 19 '05 #4
You're saying you don't want to use client side script, and then you're also
basically saying you don't want to use server side script either, by ruling
out the postback option.

I'm afraid changing the visibility of an object requires some code to be
executed, whether its client side code or server side code.

--
I hope this helps,
Steve C. Orr
MCSD, MVP
http://Steve.Orr.net

"Jon" wrote:
I'm looking for a way to toggle text without using client scripting.
One way to go is by the visibility property and a click event, but this
does a postback and returns to the top of the page. Is there a way
around this?
Jon Cosby

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Fabian | last post by:
I have a page (ok, will have a page) written in Japanese. As we all know, Japanese is written with some pretty funky characters, and it is conventional to write the so-called furigana above these...
1
by: Sarah | last post by:
Hi... I have a problem and I hope someone can help me out! I have two series of radio buttons...(call them Group A and Group B) and a Textarea. When you click on any of the radio buttons in...
2
by: leegold2 | last post by:
I wondered if anyone would give me code- I think it would be easy, but I'm a complete newbie. What I want to do is to show many tables in a brief truncated format and then for each table offer the...
4
by: Neil Coleclough | last post by:
I am constructing a database to process product returns for my Company. I have a number of toggle buttons to identify the stage to which each return has been processed. For example, clicking the...
2
by: Kingo | last post by:
Hi, First, please forgive my terrible knowledge of JS! I haven't used it in years. I am trying to create a Help page where a new question is on each line, and when clicking on the question,...
1
by: barbalu | last post by:
Hello. I'm painfully new to this and am having trouble figuring out what I'm doing wrong... I have two small tables in a simple html file. I want each table to have the ability to collapse/expand...
1
by: swiftouch | last post by:
I'm getting an error message in FF2.0: document.getElementById(toggle) has no properties The goal of the script is, when I hover my mouse over an image, to make one div element visible while...
3
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I need to toggle the text on an html input button in a .net web application. the name of the button is btn_hide and I do have an onclick function for it. <script language="javascript"...
4
by: ameshkin | last post by:
I have a checkbox with an ID of svc_tp_1, and an image that corresponds with this checkbox below it. <input type="checkbox" name="checkbox" id="svc_tp_1" value="svc_tp_1" / <img...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.