/    Sign up×
Community /Pin to ProfileBookmark

Linking checkbox to certain text

okay i have a checkbox which i want to link to a specific document that can be automatically opened. i am aware that it is possible to link this as a standard href link.

i want to go one step further i want to be able to link it to certain text within a document, possibly extending it to automatically ass it to another document. hopefully, i am clear enough with my explanation if not will clarify further. any help much appreciated

JS

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@ExuroJul 11.2005 — Maybe you could be more specific about what you mean by "linking a checkbox". You mean you're sticking an [FONT=Courier New]<a>[/FONT] element around a checkbox so that when a user clicks it they go to a new page?

Secondly, what do you mean by "link to a specific text"? Does that mean you want to jump to a specific piece of the document when the checkbox is clicked?

I think the last part about passing the text automatically will make more sense once you explain the other two parts.

It sounds like it might be good to use some server-side code here if that's possible. However, if this is just an app you're running for yourself on your computer, then it would probably be easier to just use JavaScript for the whole thing.
Copy linkTweet thisAlerts:
@WebnerdJul 11.2005 — <input type="checkbox" onclick="this.checked ? window.location='somepage.html#anchor' : ''">
Copy linkTweet thisAlerts:
@jimmysheedahauthorJul 12.2005 — ok i think i need to clarify a bit more, i want to use these checkboxes to create a template word document. ideally the following should occur, the user (me) will answer a set of questions which will find out the users needs. once a specific set of questions have been answered i will be able to narrow down the form of the template. upon checking a specific (usually the last question) in a batch it should automatically find the relevant text from a previously saved word document and copy it into a new document. ideally each batch of questions will add relevant text to the document.

An example would be:

Do you own a computer? Yes [] No []

If the user clicks the Yes checkbox it will copy some relevant text about computers into a new word document.

and if the next question is:

Do you own a dvd player? Yes [] No []

If the user clicks the Yes checkbox it will copy some relevant text about dvd players into the previous document with the text about computers.

To further clarify i was contemplating having these pre-defined sections of text maybe saved in individual documents on the server. So once a user has answered enough questions it will find the specific document and copy its contents into the new template document.
Copy linkTweet thisAlerts:
@ExuroJul 15.2005 — I don't know of any way to manipulate an MS Word document through JavaScript. I'm pretty sure there's a way to create your own "template wizard" for MS Word, so maybe you can do that. After you've created it, you could put it up for download for your users if you want.
×

Success!

Help @jimmysheedah spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...