473,396 Members | 1,995 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.

how to keep created elements in javascript on reload

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 2039
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
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

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...
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...
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...
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...
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...
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...
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...
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:...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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,...
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: 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...
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.