473,394 Members | 1,878 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,394 software developers and data experts.

dynamically creating elements with unique ids

I need to dynamically create a number of hidden input types which have unique ids like for example name1, name2, name3 etc.....
Can anyone help me???
Dec 7 '07 #1
15 2339
Hi ,

I am facing some problem in assigning name and ids to input type="hidden"
values ?? Can anyone help me out ?? I need to set names like table1, table2........etc.
Dec 7 '07 #2
Death Slaught
1,137 1GB
So you wan't to create hidden inputs with JavaScript?

Thanks, Death
Dec 7 '07 #3
Markus
6,050 Expert 4TB
Well you need to post your cofe for us, to help you with any errors.
Dec 7 '07 #4
acoder
16,027 Expert Mod 8TB
I need to dynamically create a number of hidden input types which have unique ids like for example name1, name2, name3 etc.....
Can anyone help me???
Create a variable containing the current number and update whenever a new element is created.
Dec 10 '07 #5
acoder
16,027 Expert Mod 8TB
Merged threads. As far as I can gather, this is the same problem with the same user. Please do not double post.
Dec 10 '07 #6
gits
5,390 Expert Mod 4TB
hi ...

please show how you create the nodes and the name attributes for the input-fields ... do you have tried something?

kind regards
Dec 10 '07 #7
Hello,

I 'm also in a similar situation where i need to set the input type values dynamically. In the HTML code of the web form in VB.NET, i have the following:

[HTML]<input type="hidden" name="item_name_1" value="Datastructures in C++">
<input type="hidden" name="item_description_1" value="Introduction to C++">
<input type="hidden" name="item_quantity_1" value="1"> <input type="hidden" name="item_price_1" value="31.99">
<input name="item_currency_1" type="hidden" value="USD" /> <input name="_charset_" type="hidden" value="utf-8" />
[/HTML]
Now is there a way, i can change the value for the above input types dynamically?

I wil highly appreciate your help.

hi ...

please show how you create the nodes and the name attributes for the input-fields ... do you have tried something?

kind regards
Jan 1 '08 #8
acoder
16,027 Expert Mod 8TB
Use the syntax:
Expand|Select|Wrap|Line Numbers
  1. document.forms[formName].elements[elementName].value = whatever;
Jan 1 '08 #9
You can dynamically create elements using javascript. The below link will be helpful in doing so indeed.

http://aspspider.info/magicalspell4u/?Quest=DynamicElementCreation

-Thanks
52
Jan 1 '08 #10
This is java script code but i want to be able to modify it from the vb code. Is that possible?

You can dynamically create elements using javascript. The below link will be helpful in doing so indeed.

http://aspspider.info/magicalspell4u/?Quest=DynamicElementCreation

-Thanks
52
Jan 1 '08 #11
acoder
16,027 Expert Mod 8TB
This is java script code but i want to be able to modify it from the vb code. Is that possible?
That's server-side, so just change it to display different elements/values.
Jan 2 '08 #12
Do i save it to a .js file and then call it from Page_Load? Sorry for these questions as i haven't used javascript in VB.NET

That's server-side, so just change it to display different elements/values.
Jan 3 '08 #13
acoder
16,027 Expert Mod 8TB
Do i save it to a .js file and then call it from Page_Load? Sorry for these questions as i haven't used javascript in VB.NET
I got confused from your previous reply where you said you wanted this in VB. I thought that meant using VB.NET code. To include the JavaScript, see this article which includes a section on adding the client-side script to your .NET application.
Jan 3 '08 #14
Yes i want this in VB. NET.
Thanks for the link. The items 'ClientScript' AND 'StringBuilder' are being underlined blue (ClientScript is not declared and stringBuilder is not defined)

Which class do i need to import to fix this?

Thanks


I got confused from your previous reply where you said you wanted this in VB. I thought that meant using VB.NET code. To include the JavaScript, see this article which includes a section on adding the client-side script to your .NET application.
Jan 3 '08 #15
acoder
16,027 Expert Mod 8TB
Yes i want this in VB. NET.
Thanks for the link. The items 'ClientScript' AND 'StringBuilder' are being underlined blue (ClientScript is not declared and stringBuilder is not defined)

Which class do i need to import to fix this?
I think this has left the realms of JavaScript and moved onto .NET. Ask in the .NET forum and hopefully an expert should get back to you.
Jan 3 '08 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Eric | last post by:
How can I dynamically assign an event to an element? I have tried : (myelement is a text input) document.getElementById('myelement').onKeyUp = "myfnc(param1,param2,param3)"; ...
1
by: Will | last post by:
Hi, I have a problem trying to validate dynamically created html form elements using javascript. I have dynamically created a check box using ASP for each record in a recordset and have given each...
9
by: Michelle | last post by:
I have a div that is initially empty. Clicking on a button will add some text boxes and other controls so the user can add additional records. In IE all works fine but in Netscape 7.0 when I add...
13
by: RCS | last post by:
I have a UI that needs a couple of threads to do some significant processing on a couple of different forms - and while it's at it, update the UI (set textboxes, fill in listviews). I created a...
10
by: Kathy Burke | last post by:
HI. in asp.net app, I have an xmlDocument that I transform to the client html. Using xsl I create a few textboxes to capture user input. Each of these are related to <data> elements in the xmlDoc....
19
by: matt | last post by:
I've seen several posts that begin to address this problem, but have not found a simple, elegant solution that will accomplish this goal. The important part of this solution is that it must be...
6
by: anirban.anirbanju | last post by:
hi there, i've some serious problem to add rows dynamically in a table. my table contains 5 cell. | check | from_value | to_value | color_text | color_value |...
5
by: stellstarin | last post by:
I have a html where fields are created and added dynamically on the client side. I use the AppendChild() call to create fields dynamically. On submit i try to get the value for all the...
2
by: Ed Jay | last post by:
I'm dynamically creating several form input elements: mValue = integer constant; for(var j = 0; j < mValue; j++) { target = "imgCn"+ j; eName = "myFile"; eName = eName+jj;...
9
by: Dahak | last post by:
I'm trying to generate dynamic functions to use as separate callbacks for an AJAX API call. The API doesn't seem to allow for the inclusion of any parameters in the callback, so I can't...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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...

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.