472,958 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

simple forms Q: Using images instead of radio buttons?

I've made a content managment system that uses icons to represent page
layouts. To choose a different layout, the user clicks on a radio button
associated with each layout icon. On click of one of the radio buttons, the
form submits and a new layout is chosen.

I would prefer if people can click on the icons themselves , rather than
using the radio buttons.The border or background associated with the
selected icon can highlight conditionally, based on a DB lookup. The
highlighting will indicate the selection.

I know how I could do this "by hand", associating each image with code that
would initate an insert to a database.

I would prefer it if I just bolt the image onto the existing structures in
HTML that manage radio buttons, and sub an image for the
button.

I seem to recall there is a way to do sub an image for the button. Can
anyone show me the syntax?

Right now my code looks something like this:

img name="Layout2" src="images/Layout2.gif" width="100" height="125"
border="4" alt="">
<br>
<input <%If (rsArticle.Fields.Item("Lay_LayoutID").Value) = "2" Then
Response.Write("CHECKED") : Response.Write("")%> type="radio" name="Layouts"
value="2" onclick="this.form.submit();">

Thanks,
-KF
Jul 19 '05 #1
4 3554
Ken Fine wrote:
I've made a content managment system that uses icons to represent page
layouts. To choose a different layout, the user clicks on a radio
button associated with each layout icon. On click of one of the radio
buttons, the form submits and a new layout is chosen.

I would prefer if people can click on the icons themselves , rather
than using the radio buttons.The border or background associated with
the selected icon can highlight conditionally, based on a DB lookup.
The highlighting will indicate the selection.

<cut />

HTML provides this functionality natively:

<form action="someurl.asp" method="post">
<fieldset>
<legend>Choose a Layout</legend>
<label for="layout_1">
<img src="layout1.jpg" alt="Layout 1" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="1" id="layout_1" />

<label for="layout_2">
<img src="layout2.jpg" alt="Layout 2" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="2" id="layout_2" />

<label for="layout_3">
<img src="layout3.jpg" alt="Layout 3" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="3" id="layout_3" />
<input type="Submit" value="Save Layout Choice" />
</fieldset>
</form>
--
Andrew Urquhart
- Reply: www.andrewu.co.uk/about/contact/
Jul 19 '05 #2
Sorry, I'm not being sufficiently clear.

I don't want the button interface elements to appear, just the icons, yet I
still want forms functionality.

OnClick of an icon, the form will auto-submit the chosen value to the
database.

On subsequent access, the icon's background or border will be conditionally
rendered a different color if it is chosen.

I'd prefer to still do this within an HTML forms context, just without using
any of the standard form widgets or elements (e.g. radio button.)

"Andrew Urquhart" <re***@website.in.sig> wrote in message
news:h_*************@newsfe1-gui.server.ntli.net...
Ken Fine wrote:
I've made a content managment system that uses icons to represent page
layouts. To choose a different layout, the user clicks on a radio
button associated with each layout icon. On click of one of the radio
buttons, the form submits and a new layout is chosen.

I would prefer if people can click on the icons themselves , rather
than using the radio buttons.The border or background associated with
the selected icon can highlight conditionally, based on a DB lookup.
The highlighting will indicate the selection.

<cut />

HTML provides this functionality natively:

<form action="someurl.asp" method="post">
<fieldset>
<legend>Choose a Layout</legend>
<label for="layout_1">
<img src="layout1.jpg" alt="Layout 1" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="1" id="layout_1" />

<label for="layout_2">
<img src="layout2.jpg" alt="Layout 2" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="2" id="layout_2" />

<label for="layout_3">
<img src="layout3.jpg" alt="Layout 3" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="3" id="layout_3" />
<input type="Submit" value="Save Layout Choice" />
</fieldset>
</form>
--
Andrew Urquhart
- Reply: www.andrewu.co.uk/about/contact/

Jul 19 '05 #3
Can you use <Input type=image> ?

"Ken Fine" <ke*****@u.washington.edu> wrote in message
news:c4**********@nntp6.u.washington.edu...
Sorry, I'm not being sufficiently clear.

I don't want the button interface elements to appear, just the icons, yet I
still want forms functionality.

OnClick of an icon, the form will auto-submit the chosen value to the
database.

On subsequent access, the icon's background or border will be conditionally
rendered a different color if it is chosen.

I'd prefer to still do this within an HTML forms context, just without using
any of the standard form widgets or elements (e.g. radio button.)

"Andrew Urquhart" <re***@website.in.sig> wrote in message
news:h_*************@newsfe1-gui.server.ntli.net...
Ken Fine wrote:
I've made a content managment system that uses icons to represent page
layouts. To choose a different layout, the user clicks on a radio
button associated with each layout icon. On click of one of the radio
buttons, the form submits and a new layout is chosen.

I would prefer if people can click on the icons themselves , rather
than using the radio buttons.The border or background associated with
the selected icon can highlight conditionally, based on a DB lookup.
The highlighting will indicate the selection.

<cut />

HTML provides this functionality natively:

<form action="someurl.asp" method="post">
<fieldset>
<legend>Choose a Layout</legend>
<label for="layout_1">
<img src="layout1.jpg" alt="Layout 1" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="1" id="layout_1" />

<label for="layout_2">
<img src="layout2.jpg" alt="Layout 2" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="2" id="layout_2" />

<label for="layout_3">
<img src="layout3.jpg" alt="Layout 3" width="100"
height="75" />
</label>
<input type="radio" name="layout" value="3" id="layout_3" />
<input type="Submit" value="Save Layout Choice" />
</fieldset>
</form>
--
Andrew Urquhart
- Reply: www.andrewu.co.uk/about/contact/


Jul 19 '05 #4
Ken Fine wrote:

You'll get more help for this issue if you post to an appropriate html,
dhtml or .scripting newsgroup. What you're asking about involves client-side
code, which is totally outside the realm of asp.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #5

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

Similar topics

9
by: Terrance | last post by:
Good Afternoon: I was hoping if someone could share some light on a problem that I'm facing. When I create a Visual Basic.Net program and I use the XP style for my Window Forms and buttons; if I...
13
by: LRW | last post by:
Having a problem getting a onSubmit function to work, to where it popsup a confirmation depending on which radiobutton is selected. Here's what I have: function checkdel() { if...
5
by: Digital Puer | last post by:
I have the following HTML form: - radio button A (default selected) - radio button B - input field, of type "file" with "Choose" button - submit button I would like to have it so that if the...
4
by: Marc | last post by:
Is there a way to produce 3 radio buttons, which when one is selected, enables 11 check boxes which are otherwise disabled (greyed out)? EXAMPLE: Option 1 --Radio buttons Option 2 Option 3 ...
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
4
by: Z.K. | last post by:
I started a forms application and I put on the form three buttons. In the functions for the radio buttons I put in a single messagebox like: MessageBox("Hello 1") MessageBox("Hello 2") ...
0
by: jehugaleahsa | last post by:
Hello: I have radio buttons bound to boolean properties in a business object. private void bindRadioButton(RadioButton button, string propertyName) { Binding binding =...
3
by: MazzaBee | last post by:
Hi all Complete newbie. Have a table posing the question "Which do you like best"? Two possible responses. Want to replace radio buttons COMLETELY with images that represent those possible...
1
by: sourcie | last post by:
I am changing an existing quiz found on "JavaScriptKit.com Multiple Choice Quiz" I have an image. Instead of using the radio buttons with the normal true/false question, I want to place two...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.