Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Radio Buttons & Hyperlinks?

Reply
Thread Tools

Radio Buttons & Hyperlinks?

 
 
Cerebral Believer
Guest
Posts: n/a
 
      09-24-2006
Anyone know if it is possible to use one hyperlink and a selection of radio
buttons to send a person to a particular page depending on what radio button
they check, eg.

Please Choose A Format

[a] [b] <--- radio buttons

CLICK HERE <-- hyperlink

They would need to check one button, so the page should return with an error
saying (please select a format), or send the user to a default page if no
option is selected.

Would appreciate some sample code if anyone has the time and inclination.

Regards,
C.B.


 
Reply With Quote
 
 
 
 
Harlan Messinger
Guest
Posts: n/a
 
      09-24-2006
Cerebral Believer wrote:
> Anyone know if it is possible to use one hyperlink and a selection of radio
> buttons to send a person to a particular page depending on what radio button
> they check, eg.
>
> Please Choose A Format
>
> [a] [b] <--- radio buttons
>
> CLICK HERE <-- hyperlink
>
> They would need to check one button, so the page should return with an error
> saying (please select a format), or send the user to a default page if no
> option is selected.
>


What would make this approach preferable to

Read the specs in _Format A_ or _Format B_.

where the underscore delimiters represent the beginning and end of
hyperlinks?
 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      09-24-2006
Cerebral Believer wrote:

> Anyone know if it is possible to use one hyperlink and a selection of radio
> buttons to send a person to a particular page depending on what radio button
> they check


It's certainly possible with a bit of Javascript attached to the "onclick"
event of the hyperlink, but there are probably better ways of allowing the
user to select between two different formats.

One method might be to use a submit button to submit the radio button
selection. A bit of CSS could style this to look almost exactly like a
regular link.

A better method might be to abandon the radio buttons altogether. If you
simply want to offer a choice between two different formats, you could use
two different links:

<ul>
<li><a href="high/">Broadband version</a></li>
<li><a href="low/">Dial-up version</a></li>
</ul>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
richard
Guest
Posts: n/a
 
      09-24-2006

"Cerebral Believer" <> wrote in message
news:ZrtRg.37607$...
> Anyone know if it is possible to use one hyperlink and a selection of
> radio buttons to send a person to a particular page depending on what
> radio button they check, eg.
>
> Please Choose A Format
>
> [a] [b] <--- radio buttons
>
> CLICK HERE <-- hyperlink
>
> They would need to check one button, so the page should return with an
> error saying (please select a format), or send the user to a default page
> if no option is selected.
>
> Would appreciate some sample code if anyone has the time and inclination.
>
> Regards,
> C.B.


Yes it can be done but not without some type of scripting.
Because html would not know what to do with the clicks, let alone the
buttons.
Html is purely for presentation.

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      09-25-2006
richard wrote:

> Html is purely for presentation.


No -- CSS is purely for presentation.

HTML is purely for structured content.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Cerebral Believer
Guest
Posts: n/a
 
      09-25-2006

"Harlan Messinger" <> wrote in message
news:...
> Cerebral Believer wrote:
>> Anyone know if it is possible to use one hyperlink and a selection of
>> radio buttons to send a person to a particular page depending on what
>> radio button they check, eg.
>>
>> Please Choose A Format
>>
>> [a] [b] <--- radio buttons
>>
>> CLICK HERE <-- hyperlink
>>
>> They would need to check one button, so the page should return with an
>> error saying (please select a format), or send the user to a default page
>> if no option is selected.
>>

>
> What would make this approach preferable to
>
> Read the specs in _Format A_ or _Format B_.
>
> where the underscore delimiters represent the beginning and end of
> hyperlinks?


Yes I agree I wasn't thinking straight. Actually I had been thinking of
having page A where the choice is made, leading onto page B where someone
gets use the format chosen, but I guess this is inefficient, and would
involve using two pages for the same content which could be held on one
page.

Regards,
C.B.


 
Reply With Quote
 
Cerebral Believer
Guest
Posts: n/a
 
      09-25-2006
Hi Toby,

I chose to re-think what I was doing a little after reading the responses
here. I am using FrontPage plus my own efforts to modify some of the code.
I have a page at
http://futurebydesign-music.com/_mus...e%20Listen.htm -
which is a page in progress, on a site in progress. This is what I have
done so far and is my first effort at using FrontPage.

The problem I have is that some of the images I am using do not show up,
they are used as links to streaming audio files, and although the files
reside in exactly the same directory as some other image files I am using on
this page, and the HTML code seems to be correct, but they are not
displaying (I checked they are on the server too). The images do show in
preview mode in FrontPage though, so I am wondering if my CSS has introduced
a conflict somehow which prevents the images from showing?

Here is part of my HTML

<td class="valtop">

<a class="lisbut" onmouseover="document.getElementById('trk1m').src =
'../../images/listenbuy/mp3_mo.jpg';"
onmouseout="document.getElementById('trk1m').src =
'../../images/listenbuy/mp3.jpg';"
href="../../musdir/001Rs/Smooth%20Groove.m3u" type="audio/x-mpegurl">
<img class="lisbut" id='trk1m' src="../../images/listenbuy/mp3.jpg"
alt="Smooth Groove (.mp3)"></a>

<a class="lisbut" onmouseover="document.getElementById('trk1r').src =
'../../images/listenbuy/ra_mo.jpg';"
onmouseout="document.getElementById('trk1r').src =
'../../images/listenbuy/ra.jpg';"
href="../../musdir/001Rs/Smooth%20Groove.ram" type="audio/x-pn-realaudio">
<img class="lisbut" id='trk1r' src="../../images/listenbuy/ra.jpg"
alt="Smooth Groove(.ra)"></a>

<br>

<a type="audio/x-mpegurl" title="Listen to the .mp3 sample of this track"
href="../../musdir/001Rs/Smooth%20Groove.m3u">mp3</a>&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;

<a title="Listen to the .ra sample of this track"
href="../../musdir/Smooth%20Groove.ram">real</a><br/></td>

</tr>

The relevant CSS is:

..valtop {
vertical-align: top;
text-align: center;
}
..lisbut {
border: 1.5px solid #000000;
}

Maybe I will not use CSS to align my images, perhaps it was wrong to use
text-align but instead I should have used a div or <p align="center"> tag.
What are your thoughts on this and the design in general.

Regards,
C.B.

"Toby Inkster" <> wrote in message
news:ugeiu3-...
> Cerebral Believer wrote:
>
>> Anyone know if it is possible to use one hyperlink and a selection of
>> radio
>> buttons to send a person to a particular page depending on what radio
>> button
>> they check

>
> It's certainly possible with a bit of Javascript attached to the "onclick"
> event of the hyperlink, but there are probably better ways of allowing the
> user to select between two different formats.
>
> One method might be to use a submit button to submit the radio button
> selection. A bit of CSS could style this to look almost exactly like a
> regular link.
>
> A better method might be to abandon the radio buttons altogether. If you
> simply want to offer a choice between two different formats, you could use
> two different links:
>
> <ul>
> <li><a href="high/">Broadband version</a></li>
> <li><a href="low/">Dial-up version</a></li>
> </ul>
>
> --
> Toby A Inkster BSc (Hons) ARCS
> Contact Me ~ http://tobyinkster.co.uk/contact
>



 
Reply With Quote
 
Cerebral Believer
Guest
Posts: n/a
 
      09-26-2006
No worries I fixed this. The new image files I added carried the .JPG
extension, instead of .jpg, and that made all the difference!


"Cerebral Believer" <> wrote in message
news:7qMRg.32968$...
> Hi Toby,
>
> I chose to re-think what I was doing a little after reading the responses
> here. I am using FrontPage plus my own efforts to modify some of the
> code. I have a page at
> http://futurebydesign-music.com/_mus...e%20Listen.htm -
> which is a page in progress, on a site in progress. This is what I have
> done so far and is my first effort at using FrontPage.
>
> The problem I have is that some of the images I am using do not show up,
> they are used as links to streaming audio files, and although the files
> reside in exactly the same directory as some other image files I am using
> on this page, and the HTML code seems to be correct, but they are not
> displaying (I checked they are on the server too). The images do show in
> preview mode in FrontPage though, so I am wondering if my CSS has
> introduced a conflict somehow which prevents the images from showing?
>
> Here is part of my HTML
>
> <td class="valtop">
>
> <a class="lisbut" onmouseover="document.getElementById('trk1m').src =
> '../../images/listenbuy/mp3_mo.jpg';"
> onmouseout="document.getElementById('trk1m').src =
> '../../images/listenbuy/mp3.jpg';"
> href="../../musdir/001Rs/Smooth%20Groove.m3u" type="audio/x-mpegurl">
> <img class="lisbut" id='trk1m' src="../../images/listenbuy/mp3.jpg"
> alt="Smooth Groove (.mp3)"></a>
>
> <a class="lisbut" onmouseover="document.getElementById('trk1r').src =
> '../../images/listenbuy/ra_mo.jpg';"
> onmouseout="document.getElementById('trk1r').src =
> '../../images/listenbuy/ra.jpg';"
> href="../../musdir/001Rs/Smooth%20Groove.ram" type="audio/x-pn-realaudio">
> <img class="lisbut" id='trk1r' src="../../images/listenbuy/ra.jpg"
> alt="Smooth Groove(.ra)"></a>
>
> <br>
>
> <a type="audio/x-mpegurl" title="Listen to the .mp3 sample of this track"
> href="../../musdir/001Rs/Smooth%20Groove.m3u">mp3</a>&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;
>
> <a title="Listen to the .ra sample of this track"
> href="../../musdir/Smooth%20Groove.ram">real</a><br/></td>
>
> </tr>
>
> The relevant CSS is:
>
> .valtop {
> vertical-align: top;
> text-align: center;
> }
> .lisbut {
> border: 1.5px solid #000000;
> }
>
> Maybe I will not use CSS to align my images, perhaps it was wrong to use
> text-align but instead I should have used a div or <p align="center"> tag.
> What are your thoughts on this and the design in general.
>
> Regards,
> C.B.
>
> "Toby Inkster" <> wrote in message
> news:ugeiu3-...
>> Cerebral Believer wrote:
>>
>>> Anyone know if it is possible to use one hyperlink and a selection of
>>> radio
>>> buttons to send a person to a particular page depending on what radio
>>> button
>>> they check

>>
>> It's certainly possible with a bit of Javascript attached to the
>> "onclick"
>> event of the hyperlink, but there are probably better ways of allowing
>> the
>> user to select between two different formats.
>>
>> One method might be to use a submit button to submit the radio button
>> selection. A bit of CSS could style this to look almost exactly like a
>> regular link.
>>
>> A better method might be to abandon the radio buttons altogether. If you
>> simply want to offer a choice between two different formats, you could
>> use
>> two different links:
>>
>> <ul>
>> <li><a href="high/">Broadband version</a></li>
>> <li><a href="low/">Dial-up version</a></li>
>> </ul>
>>
>> --
>> Toby A Inkster BSc (Hons) ARCS
>> Contact Me ~ http://tobyinkster.co.uk/contact
>>

>
>



 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-26-2006
Cerebral Believer wrote:
> No worries I fixed this. The new image files I added carried the .JPG
> extension, instead of .jpg, and that made all the difference!
>


Something the Windows user must always be aware if is that unlike
Windows most webservers are not on Windows platforms and filenames and
paths are case-sensitive. The domain name is only where you can be lax
because they are not case-sensitive.

I recommend any Windows users that want to do any significant amount of
web site development to find an old computer and slap together a LAMP
server and do your development there rather than with local files. Will
save you much debug frustration....

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Alan J. Flavell
Guest
Posts: n/a
 
      09-26-2006
On Tue, 26 Sep 2006, Jonathan N. Little wrote:

> Something the Windows user must always be aware if is that unlike
> Windows most webservers are not on Windows platforms and filenames
> and paths are case-sensitive. The domain name is only where you can
> be lax because they are not case-sensitive.


Well, yes, but I'd say that's putting the cart before the horse. URLs
are by definition case-sensitive, and that's got nothing to do with
the particular file system used on any specific server. It just so
happens that when URLs are mapped to files on a Windows server, then
typically two different URLs which differ only in their case are
mapped to the same file i.e although the URLs are different, they
access the same resource.

It's not a good idea to rely on this - one should be consistent.

> I recommend any Windows users that want to do any significant amount
> of web site development to find an old computer and slap together a
> LAMP server and do your development there rather than with local
> files. Will save you much debug frustration....


You make a good point. For most purposes, I'd recommend Windows users
to install Win32 Apache locally, and use that for browsing their
development site. There's far too many shortcomings involved in
browsing files directly, without a server. But in regard to case
sensitivity, it's going to have the same issues as we are discussing.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OT: How to broadcast an internet radio on a real radio world wide?] Jan C. Faerber HTML 0 06-30-2009 08:05 AM
Created Radio Buttons displaying as if they were conventional buttons Dr. Leff Javascript 3 10-15-2007 09:47 PM
Created Radio Buttons displaying as if they were conventional buttons Dr. Leff Javascript 3 10-15-2007 05:18 AM
ASP.NET Reset Radio Button in a group of Radio Buttons Scott D Johnson ASP .Net 1 09-27-2006 10:38 PM
Radio button List problem: How to find value of Radio button list's Selected Item using javascript?? Hiten ASP .Net Web Controls 1 05-26-2004 10:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57