This topic is locked

ADDING a series of records

9/19/2006 5:36:25 AM
PHPRunner General questions
T
thesofa author

Hi, having got the project running fairly well, we now have to add a new feature.

I have been asked to implement a system of block booking for pupils into detention.

My thought was one of these

1 Add the first date, then make sure the Add record page remains on screen. Using the methods detailed in the last part of this link here

I will repopulate the record page with all the details from the previous add record and increment the date by 1 day.
2 set up a form asking for the pupil details and asking for the number of days, let the teacher select the firstday and then create the records through events.
I have followed the thread on this page with interest, but I notice that all of the references from both Alexy and Jane refer to the EDIT page.

Is it possible to use the similar default values for the ADD pages too.

My favoured version of doing this will be 1 from above, but I am very happy to have useful comment from all of you.

Many thanks for all your help in the past.

Cheers

T
thesofa author 9/21/2006

Have I asked this before?

Sergey Kornilov admin 9/21/2006

thesofa,
default values work on the Add page only. On the Edit page all data come from the database.
If you like to repopulate Add form with previously entered data use the following
PHPRunner 3.0:

postvalue("value0")

postvalue("value1")

...
PHPRunner 3.1:

postvalue("value_fieldname1")

postvalue("value_fieldname2")

...
Please note that field names are case-sensitive.
Does it answer your question or you looking for something different?

T
thesofa author 9/22/2006

Please note that field names are case-sensitive.

Does it answer your question or you looking for something different?



Let me try to get this in my head.

Can it work on the Add page?

When I have added a record, will the values stick in the form after the record is saved?

Will the values stick even iff they have been entered in the first place from a lookup wizard?

Do I just put postvalue('value1') - single quote marks in the () bit - in the default value for the "View Format" in Step 7 of version 3.0?

Or does the default value go in the Edit Format section in step 7?

Or do I need to manually alter the defvalue strings?

Thanks for you support, the more I use this, the more I want to do with it <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11264&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />

T
thesofa author 9/23/2006



Let me try to get this in my head.

Can it work on the Add page?

When I have added a record, will the values stick in the form after the record is saved?

Will the values stick even iff they have been entered in the first place from a lookup wizard?

Do I just put postvalue('value1') - single quote marks in the () bit - in the default value for the "View Format" in Step 7 of version 3.0?

Or does the default value go in the Edit Format section in step 7?

Or do I need to manually alter the defvalue strings?

Thanks for you support, the more I use this, the more I want to do with it <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11280&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />



had asnother play with this, it seems the number refers to the number of the field in the sql query?

the date field seems unwilling to deliver a default value back to the datepicker, the combo box style is OK.

Thanks for the help

D
Dale 9/24/2006

Hi thesofa in all lower case :>
Just a thought.

Having a bit of trouble awhile ago trying to set a default value in a date value, it found, not only did I have to fill the value4 value but also the tsvalue4 value of my date field. The date value on my edit page would always display blank, until I filled both values.
Maybe try using the same variable that you used to fill your date field, and fill the tsvalue field also.

The tsvalue is the datepicker date value.
As I said, just a thought.

T
thesofa author 9/24/2006

Hi thesofa in all lower case :>

Just a thought.

Having a bit of trouble awhile ago trying to set a default value in a date value, it found, not only did I have to fill the value4 value but also the tsvalue4 value of my date field. The date value on my edit page would always display blank, until I filled both values.
Maybe try using the same variable that you used to fill your date field, and fill the tsvalue field also.

The tsvalue is the datepicker date value.
As I said, just a thought.



decided to play a bit more with this, i used a session variable to set the date in the default value box, so 1st time round the date box is empty, then it reflects the date entered from the form, so I can just increnmet it from the date picker.

Many thanks for all the help again.

Cheers

Alexey admin 9/25/2006

Hi,
with the latest PHPRunner release there is an easy way to make Add page remember previously entered values.

Build the pages with the latest (build 151) PHPRunner, open generated ..._add.php file with a text editor.

Find this line there:

$readavalues=false;

and change it to:

$readavalues=true;