CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Reload page without losing values

Print topic Send  topic

Author Message
lquental

Posts: 15
Posted: 11/16/2004, 2:27 PM

Hi everyone,

Do you have any idea how can I reload a page (record from)
without losing the inserted values?

I have a listbox event onchange to do this is JavaScript:

window.location.reload();

If I use Firfox the form doesn't loose the values, but it looses the values with IE?

Any ideas?

I tried submiting the form (also a valid option), but I canīt get ride of the validation errors.

Thnaks in advance
View profile  Send private message
peterr


Posts: 5971
Posted: 11/16/2004, 10:22 PM

I don't think that this is possible, since the fact or "reloading" a page means exactly reloading it and deleting all temporary information that wasn't submitted.
Submitting the values first would probably be the right solution, but as you noted the values are being validated.

Maybe you'd like to explain why you're reloading the page, as there could be some other ways to go about this.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
lquental

Posts: 15
Posted: 11/17/2004, 1:50 AM

I'm reloading the page because I have two dependant listboxes and the second one dependes on the value selected on the first one.

Regards,

Luis
View profile  Send private message
lquental

Posts: 15
Posted: 11/19/2004, 10:01 AM

Hi,

So, does anyone here have an idea how to work arround this?
I have a finished project, with this little issue to correct.
If some one could explain me how to "at least" disable the validation of the fields before submit I would really appreciate it.

Thanks,

Luis
View profile  Send private message
klwillis


Posts: 428
Posted: 11/19/2004, 10:18 AM

I believe this can be done, but it is tricky. ;-)

On your JavaScript 'OnChange' event for the button,
just submit the form.
(NOTE: If you've done any client-side validation, you'll have to
use a global variable which is used as a flag to bypass the validation).

Now, the trick part is bypassing the server-side field validation and
making sure the data is not written to the database.

If anyone know the code to ignore server-side validation, as
well as bypassing writes to the database - we'll have a solution
to this. :)

Quote lquental:
Hi,

So, does anyone here have an idea how to work arround this?
I have a finished project, with this little issue to correct.
If some one could explain me how to "at least" disable the validation of the fields before submit I would really appreciate it.

Thanks,

Luis
;-)
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
klwillis


Posts: 428
Posted: 11/19/2004, 10:19 AM

Oops ... I meant the 'OnChange' event for your listbos. :)

Quote klwillis:
I believe this can be done, but it is tricky. ;-)

On your JavaScript 'OnChange' event for the button,
just submit the form.
(NOTE: If you've done any client-side validation, you'll have to
use a global variable which is used as a flag to bypass the validation).

Now, the trick part is bypassing the server-side field validation and
making sure the data is not written to the database.

If anyone know the code to ignore server-side validation, as
well as bypassing writes to the database - we'll have a solution
to this. :)

Quote lquental:
Hi,

So, does anyone here have an idea how to work arround this?
I have a finished project, with this little issue to correct.
If some one could explain me how to "at least" disable the validation of the fields before submit I would really appreciate it.

Thanks,

Luis
;-)

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
lquental

Posts: 15
Posted: 11/19/2004, 12:27 PM

Thanks any way, but the submit part was already done.


Quote klwillis:
Oops ... I meant the 'OnChange' event for your listbos. :)

Quote klwillis:
I believe this can be done, but it is tricky. ;-)

On your JavaScript 'OnChange' event for the button,
just submit the form.
(NOTE: If you've done any client-side validation, you'll have to
use a global variable which is used as a flag to bypass the validation).

Now, the trick part is bypassing the server-side field validation and
making sure the data is not written to the database.

If anyone know the code to ignore server-side validation, as
well as bypassing writes to the database - we'll have a solution
to this. :)

Quote lquental:
Hi,

So, does anyone here have an idea how to work arround this?
I have a finished project, with this little issue to correct.
If some one could explain me how to "at least" disable the validation of the fields before submit I would really appreciate it.

Thanks,

Luis
;-)

View profile  Send private message
Ahaa
Posted: 11/19/2004, 12:49 PM

I have implemented similar feature in my project.

You are on the right track with the onchange event of the lisbox but the data source (SQL) code of the lisboxes would enable you to achieve it quickly. The parameters that will populate the lisboxes is a bit tircky.

What I did was not to show any value in the dependent listbox unless a value is selected from the parent listbox.

And set the dependednt listbox Required Property = "YES" in the design view of your project. This feature will stop the content of the form from being inserted into the database and the entries on the form would remain intact till the value for the dependent listbox is provided.

If you have problem with SQL side of things, I can give you a hand with that.

I hope you find this information helpful.

Cheers,
Ahaa


Quote lquental:
Hi,

So, does anyone here have an idea how to work arround this?
I have a finished project, with this little issue to correct.
If some one could explain me how to "at least" disable the validation of the fields before submit I would really appreciate it.

Thanks,

Luis
klwillis


Posts: 428
Posted: 11/19/2004, 2:33 PM

A much simpler method is to use a hidden-field which is required.
Let's call the field 'commit_data'.

For the 'BeforeShow' event for this field, set the value
of commit_data to anything you like (i.e. "Yes")

When the 'OnChange()' event occurs for your listbox, change the
value of commit_data to "".

Then, let CodeCharge Studio do the rest. ;-)

It works very nicely, but the only draw-back is that you'll have to
provide custom error handling for your data fields, and you'll need
to remove the default '{Error}' lable placed on the form.

Personally, I never liked the default way of displaying errors, it's
much nicer if you provide the error by the field that generated the
error anyways.


_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
lquental

Posts: 15
Posted: 11/20/2004, 11:17 AM

Thanks guys, I finally got it to work, with the hidden field trick. :-)

Luis
View profile  Send private message
klwillis


Posts: 428
Posted: 11/20/2004, 4:04 PM

Now, if you can use that same technique for a form which
does NOT have a data source attached to it, please let me know. ;-)

Quote lquental:
Thanks guys, I finally got it to work, with the hidden field trick. :-)

Luis

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
klwillis


Posts: 428
Posted: 11/23/2004, 7:47 AM

Disregard - everything works fine, provided you haven't messed-up
your client-side JavaScript. :-)

Quote klwillis:
Now, if you can use that same technique for a form which
does NOT have a data source attached to it, please let me know. ;-)

Quote lquental:
Thanks guys, I finally got it to work, with the hidden field trick. :-)

Luis

:-)
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright Đ 2003-2004 by UltraApps.com  and YesSoftware, Inc.