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

Storing newly Incremented number

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 1570
hsriat
1,654 Expert 1GB
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
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 Expert 1GB
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
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 Expert 1GB
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
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 Expert 1GB
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
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 Expert 1GB
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
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...
6
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...
5
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...
2
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...
5
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...
1
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...
15
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...
0
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...
9
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...
5
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.