473,406 Members | 2,633 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,406 software developers and data experts.

how to keep created elements in javascript on reload

samikhan83
hi All Experts.... once again i am in some problem.......

i have a form which creates a new textbox elements when a new product is scanned with barcode scanner.

Problem is when i submit the form and check for server side validation if the form have some error according to validation it is going to the form again and all the generated textbox vanishes ... and i am loosing all the entered data and fields.

There is any way to keep the generated element intact with there respective data .

so please can anybody help me with this .

Waiting For Your Reply
Aug 25 '08 #1
4 2040
Dormilich
8,658 Expert Mod 8TB
as I understand it right, the barcode scanner fires a javascript event that creates the textbox, right?
in that case, the returning form (from the failed validation) misses that event and the standard form is returned. you can only prevent that by explicitly writing a new textbox through the server side script with the data as default value (and of course interrupting the barcode event as long as the validation process is not finished).

hope that helps a bit
Aug 25 '08 #2
Thanks For Your Reply....

i to thought of doing that ...... but is there anyway of caching the element and the values and reusing it .....

instead of regenerating all the elements again.... because it very complex form...

where form is for Purchase Invoice Entry of inventory system where user will scan product after product like multiple product with there serial number so
for each product upc code new elements with zero value price,quantity and serial number will be generate and each product have multiple serial number.....

so the form grow dynamically by getting the values from database with AJAX....

if there is any solution then highly APPRECIATED....
Aug 25 '08 #3
Dormilich
8,658 Expert Mod 8TB
i to thought of doing that ...... but is there anyway of caching the element and the values and reusing it .....
you might try to send the form element collection back as an AJAX request (I think you have to serialize, WDDX is worth looking at).
Expand|Select|Wrap|Line Numbers
  1. // general idea:
  2. var form = serialize(document.forms[0]);
  3. ...
  4. XMLhttpRequest.send(form);
Aug 25 '08 #4
yaah i will give it a try... i think it should work

thanx for your suggestion....
Aug 26 '08 #5

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

Similar topics

2
by: Michael | last post by:
I am reading and setting a cookie using JavaScript in the BODY onload and onunload events respectively. This works fine. However when I use ASP to set the cookie under some condition where I...
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...
5
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
3
by: nkoriginal | last post by:
Hello: I tried an script for keep my data form after reload page, but I've some errors. In this momento I runnung my own browser because we've an intranet. And for security reason, our page...
1
by: nkoriginal | last post by:
Hello Again: I've a problem with my forms. I woking with an intranet, and the pages in that intranet, has a reload page, every 10 minutos. So my problems star, when any user stay in my forms...
3
Ajm113
by: Ajm113 | last post by:
Ok for some reason after the update of Firefox it seems that my form keeps getting submitted when the user made a error on the form. I just want the page to reload so the user may try again. Because...
5
by: gyip | last post by:
My environment: IE7 browser hitting an ASP.NET webpage that uses Javascript to render the contents. This is not an ASP.NET problem but a Javascript problem that I am encountering. Problem:...
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
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
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...

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.