473,804 Members | 4,288 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing newly Incremented number

20 New Member
Hi,

I have a form on our internal intranet that has a field called Report ID. When the user clicks the print button, this number increments by one. The problem is, the newly incremented number is not stored for the next time the web page is loaded. It defaults back to 111 (which is what I currently have it set to). I'm using Sharepoint Designer 2007 but my increment function is in Javascript.

Can someone help me and let me know what I need to do to make the newly stored number stick? Thanks.
Apr 3 '08 #1
9 1591
hsriat
1,654 Recognized Expert Top Contributor
When a page is loaded, the JavaScript variables' values are not retrieved, instead, the variables are washed from the memory as soon as the page is unloaded or closed.

For your problem, you can save (and increment) the variable value in a file (or database) through the server side script and retrieve it when page loaded again.


Regards
Apr 3 '08 #2
jalley06
20 New Member
When a page is loaded, the JavaScript variables' values are not retrieved, instead, the variables are washed from the memory as soon as the page is unloaded or closed.

For your problem, you can save (and increment) the variable value in a file (or database) through the server side script and retrieve it when page loaded again.


Regards
I don't suppose you could point me in the right direction as to how to go about doing that could you?
Apr 3 '08 #3
hsriat
1,654 Recognized Expert Top Contributor
I don't suppose you could point me in the right direction as to how to go about doing that could you?
I pointed you in the right direction (though I didn't tell the complete code for that).
Did you read the second line (second para)?
Apr 3 '08 #4
jalley06
20 New Member
I pointed you in the right direction (though I didn't tell the complete code for that).
Did you read the second line (second para)?
If I had not read it then I would not have replied back. I don't want you to send me the code word for word, I just wanted to know where on the server I would put this "file", what kind of "file" are you talking about? How would I call it? I can't link it to a database because of the way the form has to be designed combined with the fact that I'm using Sharepoint Designer to do this with (unfortunately) .

I am new at this so if you don't want to help me that's fine but there's no need to be rude.
Apr 3 '08 #5
hsriat
1,654 Recognized Expert Top Contributor
I am new at this so if you don't want to help me that's fine but there's no need to be rude.
I was not being rude, I just found your reply rude.
Well, never mind.

For saving the file, you need a server side script (something like PHP or ASP) and I think you are not using that.
And JavaScript doesn't have access to the file system, so that's nearly impossible with JS.

But you can save your variable using cookies.
But again, if cookie is deleted, your variable will be reset.

So I would recommend it saving it in a file. If you are already using some server side script, then tell me, I can guide you in that.

Regards,
Harpreet
Apr 3 '08 #6
jalley06
20 New Member
I was not being rude, I just found your reply rude.
Well, never mind.

For saving the file, you need a server side script (something like PHP or ASP) and I think you are not using that.
And JavaScript doesn't have access to the file system, so that's nearly impossible with JS.

But you can save your variable using cookies.
But again, if cookie is deleted, your variable will be reset.

So I would recommend it saving it in a file. If you are already using some server side script, then tell me, I can guide you in that.

Regards,
Harpreet
Well I guess I mistook the tone of your message. Sorry about that.

Anyway, I don't have any server side scripts running at the moment. I have several Javascript functions on my page (to print the page, to increment the number, and to make a running sum of two columns on the page and am currently working on a script that will email the form automatically to a certain user in our company which I'm told needs to be server side as well)

Needless to say, I have no experience with server side scripts. I've seen several people mention php but have no idea how to start with it. Is the php.ini file something that is on the server already or do I need to get it and put it somewhere on the server? Sorry for all the basic questions but like I said, I've never dealt with this.

It would be great if Sharepoint Designer were more intuitive about these kind of features, but sadly no. Thanks.
Apr 4 '08 #7
hsriat
1,654 Recognized Expert Top Contributor
I guess you need to start with server side scripting. Its not difficult though but the Sharepoint Designer will not let you use it (I think).

PHP is what I would recommend.

Find its tutorials here.


Good Luck

Harpreet
Apr 4 '08 #8
jalley06
20 New Member
I guess you need to start with server side scripting. Its not difficult though but the Sharepoint Designer will not let you use it (I think).

PHP is what I would recommend.

Find its tutorials here.


Good Luck

Harpreet
Ok I have PHP already installed on the server here. The mail settings are also defined. If I use the mail() function, where would I put the syntax in my form, between the body tags? Also, how would I get the form itself to either attach itself to the email or paste itself in the email. Thanks for the link btw, it helps alot.
Apr 4 '08 #9
hsriat
1,654 Recognized Expert Top Contributor
I can help you in that too, but it would be better if you ask this in the PHP forum.


Regards
Harpreet
Apr 4 '08 #10

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

Similar topics

14
2607
by: mjkahn | last post by:
I've read (and read!) that you shouldn't store objects in Session variables. I've read these reasons: - The object takes up memory that may not be freed until the session times out. Better to create the object only when you actually use it. - Causes poor performance because the thread that created the object has to service all requests for it. Assuming I can live with the memory and performance implications (a big if,
6
2583
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a "SEGV" when run (presumably - attempt to delete deleted memory. Please take a look and see if you can notice any mistakes I'm making. Basically, I want to store classes of my objects in a vector. I also have three further questions:
5
2148
by: Don Vaillancourt | last post by:
I'm building a system when one can upload a document to the website. I will be storing the document on the hard-drive for quick/easy access, but I was also thinking of storing it in an existing database since most of the sites information is all stored there. As well there would be only one place to worry about backing up. And if the file on the hard-drive was ever missing or became corrupted, I could restore it form tha database. Is...
2
1943
by: Kay | last post by:
A linked list is storing several names. I want to make a queue if I input a name that is same as the linked list. How to make each node of a linked list storing a queue that are different with each other node, do I need to add one more item in the ListNode OR I only call the queue insert function to do it ?
5
2487
by: Phil Latio | last post by:
I have 2 virtually identical tables and wish to move data between them. Basically one table is called "live_table" and the other is named "suspended_table" and the only difference is that the primary key in the "suspended_table" is an auto incremented integer where as "live_table" primary key is just a standard integer. Here's the life-cycle: 1. Record gets entered into "suspended_table" 2. Record checked and then inserted into...
1
7917
by: mike | last post by:
I have a datagridview control and a button on the windows form. I am adding a new row in button click event. When the number of rows grow, the newly added row will not be visible but a scroll bar will be shown. I want the program to highlight the newly added row and make it visible in the datagridview by scrolling to that position when a new row was added by button click event. How can you do that? Thanks in advance.
15
2088
by: A. Farber | last post by:
Hello, I'm programming a web game on OpenBSD, but am also trying to keep in runnable on Linux and Cygwin. I have a list of tables at which a player/kibitzer can sit down or create a new empty one if (s)he wants. I keep tables in a doubly-linked list using the nice TAILQ_* macros: http://www.openbsd.org/cgi-bin/man.cgi?query=queue
0
864
by: Chris B | last post by:
Howdy, When the AddNew button is clicked on the BindingNavigator, a new row is made in the datagrid and the row selector moves to that newly created row, what is the method that moves the selector to the new row? I have created a method that calls the AddNew method on a DefaultView and creates a new row. I need to move to that newly created row and get the value from a auto-incremented cell in the new row and then populate a combo box with...
9
2891
by: paragthakur | last post by:
Hi All... I m developing a collection record module. In which the invoice number field should be auto incremented.... My problem is :"How can i access the current+1 invoice number in new form entry which is to be filled"... Pls help me with u r solutions....
5
1386
by: jalley06 | last post by:
Hi all, I have a form with a field called ReportID in aspx on our local Intranet. Everytime this report is loaded into a browser, I need the ReportID field to be incremented by one. I got this to work with Javascript except when the page was closed and reloaded, the ReportID field was set back to one instead of storing the new number and incrementing from there. I was told that writing a PHP script and storing the incremented number in a...
0
10340
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
10329
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
10085
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
9163
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
7626
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
5527
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...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3000
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.