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

unable to access the values of input elements created using javascript

I have added some input elements on a page using
javascript at client side.
when i submit the page, i am unable to access the values
of input elements created using request.form.
Are elements created using javascript are available at the
server?
if not how can i do the above thing so that there values
can be accessed.
I dont want to postback page everytime i need to create a
new element.

Nov 19 '05 #1
6 2147
Vikram,

When you create your input elements are you adding the runat="server"
attribute? That should make the control available on the server (I
think). Of course you will have to cast it to the proper type.

Let me know how you make out.

Nov 19 '05 #2
No basically after a page is displyed at client, user can
click a '+" button which will create text box without
posting back to server i.e. using javascript.
After that user will submit the page.....
-----Original Message-----
Vikram,

When you create your input elements are you adding the runat="server"attribute? That should make the control available on the server (Ithink). Of course you will have to cast it to the proper type.
Let me know how you make out.

.

Nov 19 '05 #3
Are you adding the name property of the control? Without the name property
I do believe the element is not considered postable.

<input type="text" name="txtDynamic" />

Request.Forms["txtDynamic"];

bill

"Vikram" <an*******@discussions.microsoft.com> wrote in message
news:0f****************************@phx.gbl...
I have added some input elements on a page using
javascript at client side.
when i submit the page, i am unable to access the values
of input elements created using request.form.
Are elements created using javascript are available at the
server?
if not how can i do the above thing so that there values
can be accessed.
I dont want to postback page everytime i need to create a
new element.

Nov 19 '05 #4
Understood. But when that textbox is created you must specify certain
attributes of the input element Such as the name property (as Bill
pointed out). Then if you want to access these WHEN the postback occurs
you will also have to add the runat=server attribute.

Send a code snippet if you like and we can get it you work for you.

Nov 19 '05 #5
you are probably missing the name attribute. try:

in browser:

<script>
document.write('<input type="text" name="myText" value="test value">
</script>

on postback:

sting myValue = Request.Form["myText"];

-- bruce (sqlwork.com)
"Vikram" <an*******@discussions.microsoft.com> wrote in message
news:0f****************************@phx.gbl...
I have added some input elements on a page using
javascript at client side.
when i submit the page, i am unable to access the values
of input elements created using request.form.
Are elements created using javascript are available at the
server?
if not how can i do the above thing so that there values
can be accessed.
I dont want to postback page everytime i need to create a
new element.

Nov 19 '05 #6
Thanks a lot.
U were right
-----Original Message-----
you are probably missing the name attribute. try:

in browser:

<script>
document.write('<input type="text" name="myText" value="test value"></script>

on postback:

sting myValue = Request.Form["myText"];

-- bruce (sqlwork.com)
"Vikram" <an*******@discussions.microsoft.com> wrote in messagenews:0f****************************@phx.gbl...
I have added some input elements on a page using
javascript at client side.
when i submit the page, i am unable to access the values
of input elements created using request.form.
Are elements created using javascript are available at the server?
if not how can i do the above thing so that there values
can be accessed.
I dont want to postback page everytime i need to create a new element.

.

Nov 19 '05 #7

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

Similar topics

1
by: Roger Godefroy | last post by:
Hi there... I want to read fieldvalues from out of a dynamicaly created table (php). But this has to be done by JavaScript. Every row of the table has a select-box, inputbox and a order-button....
1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
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...
15
by: crjunk | last post by:
I have 4 TextBoxes on my form that I'm trying to add together to get a grand total. Here is the code I'm using: <SCRIPT LANGUAGE="JavaScript"> <!-- Beginning of JavaScript - function...
7
by: Utter Newbie | last post by:
Just wondeing if there is a way to keep from having a certain parameter sent when posting a form to another page (method=get)... So as an example a page will post something like this from a form...
10
by: soup_or_power | last post by:
The pop up window has several checkboxes. I'm unable to access the checkboxes using the handle from window.open. Any way to do this? var display; function showSugg(but_id, sugg1, sugg2, sugg3,...
7
by: Lau Lei Cheong | last post by:
Hello, I'm using javascript's insertAdjacentHtml() to insert images to the webform at runtime. This runs fine(image successfully displayed at the browser) but when I tried to access 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;...
3
by: nicky77 | last post by:
Hi there, newish to javascript so grateful for any help. I am creating a test generator and have an array of textfields ("answer") created by a simple piece of PHP code. As you can see, I have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...
0
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,...

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.