View Full Version : Page redirect based on text box value
ZxIRAX
07-29-2008, 03:55 PM
Hi guys, I am new to this so I am not sure which forum is best to post my question, as I am sure it could be created using javasctipt or vb, etc.
Basically, I have a webpage with text boxes, the values are blank by default. When a customer calls in the text boxes are populated with the values queried against a database.
What I would like to do is:
When the page loads and the values are populated in the text boxes a scipt will check the reference number value from one of the text boxes and change the page.
For instance if we say that the reference number text box is called REF, and it is populated with a value of 001 then it would redirect to a page called 001.html. If REF is populated with a value of 002 then it would redirect to a page called 002.html, etc.
Ideally when the redirect occurs the values on the orniginal page will shown on the new page.
I hope that I have explained myself clearly enough.
Thanks in advance for your help!!
jscheuer1
07-29-2008, 06:03 PM
I know enough to know this cannot be done using HTML (the forum you posted in). I think that server side code like PHP or asp would be best. A javascript assist for those with javascript enabled could make the interface more intuitive, but cannot be relied upon in a commercial environment without a server side fall back. Even so, security is low with javascript if you are not careful how it is used.
Alternatively, if this is a low priority matter where security is of no concern, it could probably all be done with javascript. But it would work only for javascript enabled browsers, and could be messed with (amounts and other values could be changed by savvy users in ways you might not anticipate).
I'm not really skilled enough in server side code to write this up easily for you, and it appears to me to be the sort of thing that even an experienced server side coder would need to spend quite a bit of time on, so might go better in the job request forum.
But far be it from me to sign you up for a paid service without your permission.
If your host has PHP or asp, I could move it to one of those free forums (but that won't change the fact that this will probably be a rather large job for anyone to do for free), or if you would like this to go to the formal job requests area, I can move it there too.
ZxIRAX
07-30-2008, 06:54 AM
Hi John,
Thanks for your reply!
I appreciate your comments, and understand that it would be a fairly lage job for an experianced programmer. This is way beyond my skill set.
Would it be easier for me to say that:
REF is populated with a value of 001 then it would change the background colour to black. If REF is populated with a value of 002 then it would change the background colour to white.
I guess that Javascript would do the job fairly easily here
jscheuer1
07-30-2008, 07:00 AM
No need to be so mysterious, or whatever. Now it sounds like you just want a stylesheet switcher. Is that it? If so, see:
http://www.dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm
ZxIRAX
07-30-2008, 10:46 AM
Hi John,
Let me try to explain a little better, ignoring my previous two posts as I think this will be the easiest to achieve.
I have a webpage with multiple text boxes. these text boxes are automatically populated with a value when a customer calls in. For example:
A customer calls in on the telephone number 1234567890, the database looks up their details for this number, which populates the text boxes on the webpage.
From here, there are 3 possible reference codes 001, 002, 003. I would like different text to appear on the screen for each refence code which is populated. For example:
If the customers reference code is 001, a value of 001 will be populated in the text box on the webpage. I need some way of adding text that will appear on that webpage to say English Account. If the value is 002 then it would say American Account. If the value is 003 then it would say New Account.
Thanks again for your help!!
jscheuer1
07-30-2008, 01:37 PM
I'm still trying to understand. Customers won't see any of this, right? It's your employees, or yourself that need this functionality, and it will only be used to direct them to the proper page, not to pass currency amounts or item quantities, so we can dispense with intense security precautions, right?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.