473,796 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get values of dynamically created radio button control

Hi,

I have the following code which displays all the images from a
specific folder with a Radio button in it:

Dim objFile
i = 1
For Each objFile In objFolder.Files

If (i = 1) Then Response.Write( "<TR>")

Response.Write( "<TD align='center'> ")
Response.Write( "<IMG src='" & f_strCardPath & "\" &
objFile.Name & "' width='150px' height='150px'> ")
Response.Write( "<BR><INPUT type='radio' name='rdCardPic s'
value='" & objFile.Name & "'")
Response.Write( "</TD>")

If (i = 2) Then
Response.Write( "</TR>")
i = 1
Else
i = i + 1
End If
Next

Now, the above with the other needed code is in a function (in
..aspx.vb
file) and I call it in the .aspx file as <%
DispImages(\ima gefolderpath) %>

But once the user selects the image he wants, I want to pick up the
selected value of the radio button, how do I do that ?. Anybody got
any example on this ?.

Please help, thanks.

Regards,
Karthick
Nov 18 '05 #1
1 3325
The problem is that your inputs do not have ID's that are name friendly,
meaning, they are created dynamically, so their ID is not something easy to
determine at run time without knowing some data first. I would in your case,
place this information in a DataRepeater, and set a group for your radio
buttons. Give some common name to both the image and the radio button. I
might even use an asp:imagebutton instead of an html image control. If you
can send your viewed source from your browser, I can take a better look at
how the controls are rendered to the screen and perhaps add more. The part
that is tricky is when you click on an image, how can you tell which radio
button this corresponds. Send some html viewed source so we can look at it.

Alex

"Karthick Kumar" <tv********@gma il.com> wrote in message
news:29******** *************** ***@posting.goo gle.com...
Hi,

I have the following code which displays all the images from a
specific folder with a Radio button in it:

Dim objFile
i = 1
For Each objFile In objFolder.Files

If (i = 1) Then Response.Write( "<TR>")

Response.Write( "<TD align='center'> ")
Response.Write( "<IMG src='" & f_strCardPath & "\" &
objFile.Name & "' width='150px' height='150px'> ")
Response.Write( "<BR><INPUT type='radio' name='rdCardPic s'
value='" & objFile.Name & "'")
Response.Write( "</TD>")

If (i = 2) Then
Response.Write( "</TR>")
i = 1
Else
i = i + 1
End If
Next

Now, the above with the other needed code is in a function (in
.aspx.vb
file) and I call it in the .aspx file as <%
DispImages(\ima gefolderpath) %>

But once the user selects the image he wants, I want to pick up the
selected value of the radio button, how do I do that ?. Anybody got
any example on this ?.

Please help, thanks.

Regards,
Karthick

Nov 18 '05 #2

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

Similar topics

3
2832
by: lee | last post by:
Hello I need some javascript code I've written to handle 2 values from an HTML form. I've been successful using the "label" attribute (I've simplied the example below): <input type="radio" name="group1" value="3" label="Cheese" checked>Cheese<br>
3
5183
by: Mike P | last post by:
I am working with some code where a number of contacts are taken from a table and then added to a page with a radio button to the right of each one where the name of each radio button has the contact key appended. RadioButton rbtn = new RadioButton(); rbtn.ID = "btn" + ds.Tables.Rows.ToString(); rbtn.GroupName = "Group1"; rbtn.CheckedChanged += new
0
1379
by: sat1582 | last post by:
I need avoid postback in a radio button control when press enter key, if you know how do this please tell me. Thanks for your response at sat1582@hotmail.com
0
1287
by: Jimstershat | last post by:
Hello Everyone, I need to do the following; I need to create the following url using a radio form: http://www.domain.com/addtocart.aspx?productid=18&variantid=37&quantity=1 I need to be able to let the customer choose different product ids that always have a variant id associated with each product id. In other words If customer chooses product 1 it will always have a variantid= 10 and product 2 will always have variantid=20. So .. I...
2
4527
by: romano2717 | last post by:
i have a set of radio buttons generated inside a loop then i append a variable from the loop to the name of the radio button and to the value. the question is, how do i get the value of the radio button being selected. here's a short code.. <?php for($i=1; $i<=5; $i++){ echo "<input type = 'radio' name=q$i value = \'$i\'>"; } ?>
7
4876
by: moksha | last post by:
Hi, I am new to javascript and i am facing a problem in coding. plz help me out. I am using javascript for dynamically creating a table row which contains text boxes and radio buttons and check box. I am adding two radio buttons once for a row.Now my problem is the radio buttons in all the rows that added dynamically are behaving as same group i.e when i am selecting a radio button in second row,radio button in first row...
5
6707
by: satyabhaskar | last post by:
hi all, In my web page i have created radio buttons dynamically on to the page .....following is my code string Course, Semester, Section; int rowsCount; string con = ConfigurationManager.ConnectionStrings.ConnectionString; protected void Page_Load(object sender, EventArgs e) { try
3
3138
by: vidhya raman | last post by:
I have dynamically created radio buttons.how to get the value of these buttons using post. $i=1; <input type="radio" name="qtn-$i" value="yes"> $i++; how to get this value using post method.
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.