473,809 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send maximum value to either of two database fields?

Hi there,

I'm a complete zero at javascript in need of a hero. I run a free,
non-commercial site which includes a searchable database of hotels in
Morocco.

Find the page at http://www.triotours.com/faq/ma/hotel-search.htm

The form works fine, except for two essential functions:

1. Visitors enter the maximum amount of money they want to spend per night
("maxrate")
2. Visitors then enter whether the maximum amount is for a single or a
double room ("roomtype")

The CGI script would then search for a value between 1 and "maxrate" in the
field set by "roomtype", which could be either "single" or "double".

Can anyone of you help me with the code to do this? It would be much
appreciated!
Jul 23 '05 #1
4 2439
In article <d1**********@r eader11.wxs.nl> , triotours@*N0SP AM*planet.nl
enlightened us with...

The CGI script would then search for a value between 1 and "maxrate" in the
field set by "roomtype", which could be either "single" or "double".


This is a javascript group.

What language is your CGI?
Try posting this at a group geared to that.

comp.lang.perl would be your best bet, I would guess, since you called it a
CGI script. :)

--
--
~kaeli~
A man's home is his castle..., in a manor of speaking.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
OK, I can see what you mean. :-)

But I was told I could use javascript to "assemble" the right info
client-side on the html page BEFORE sending it to the script.

Only thing is, I have no clue about javascript.

"kaeli" <ti******@NOSPA M.comcast.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...
In article <d1**********@r eader11.wxs.nl> , triotours@*N0SP AM*planet.nl
enlightened us with...

The CGI script would then search for a value between 1 and "maxrate" in the field set by "roomtype", which could be either "single" or "double".
This is a javascript group.

What language is your CGI?
Try posting this at a group geared to that.

comp.lang.perl would be your best bet, I would guess, since you called it

a CGI script. :)

--
--
~kaeli~
A man's home is his castle..., in a manor of speaking.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
dysfunctional wrote:
OK, I can see what you mean. :-)

But I was told I could use javascript to "assemble" the right info
client-side on the html page BEFORE sending it to the script.

Only thing is, I have no clue about javascript.


There is no point to 'assembling' the info on the client
machine. Just post the values back to your server and deal with
them there. Why make your page dependent on JavaScript
needlessly?

You have to validate the return values on the server anyway -
users may not have JavaScript enabled and the return may not
have actually come from your page - you have no idea how the
return values were generated or the intent of the person that
sent them.

Just consider if you have a script that creates a query for your
database on the client and you simply run it at the server with
out checking or validating anything. Anyone can create whatever
query they like and attempt to run it on your server.

So just let users pick reasonable values in your page and submit
them back to the sever. Perhaps you could offer rate ranges as
a set of radio buttons so users don't enter anything?
--
Rob
Jul 23 '05 #4
In article <d1**********@r eader11.wxs.nl> , triotours@*N0SP AM*planet.nl
enlightened us with...
OK, I can see what you mean. :-)

But I was told I could use javascript to "assemble" the right info
client-side on the html page BEFORE sending it to the script.

Only thing is, I have no clue about javascript.


Javascript validation is best used in addition to any server-side validation,
as a courtesy to users who have it enabled so they don't have to wait for the
document to be sent to the server, rejected, and get the message back.

If you do it only with javascript, it's VERY hackable. ;)

If this isn't about validation, then I'm unclear on exactly what you're going
for. I don't see quite what you mean if you wanted javascript to do this:

"The CGI script would then search for a value between 1 and "maxrate" in the
field set by "roomtype", which could be either "single" or "double"."

I'm a bit database-centric in my application viewpoint, since I work with
them all the time. To me, it seems like that's a database search. Which JS
can't do. Am I misunderstandin g what you want?

--
--
~kaeli~
Quantum Express: When you absolutely, positively, don't
know where it's going or when it needs to be there.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5283
by: Matt | last post by:
I am running CR 8.5 from a (large) SQL Server db. My aim is to use crystal enterprise so end users in our sales team can access reports on demand for a given date range and client so I am trying to keep contact with the database to a minimum. IE currently processign a report takes about 10 minutes and involves manually running stored procs in sql server to produce smaller, client specific temporary tables that CR can easily cope with. ...
2
28604
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
15
12142
by: Lauren Wilson | last post by:
Access 2K dim MyStr as string What is the maximum amount of text or bytes that this variable can store? Does anyone know?
2
20753
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none But the problem occures when i want to send a data with & sign (i.e: Firm=F&B). I try to solve this problem with using boundary, but i failed. Any idea!?
1
3374
by: Net Virtual Mailing Lists | last post by:
Hello, Lets say I have data like this: value1|value2|value3|value4|....|value(N) ------|------|------|------|----|-------- 100 | 200 | 300 | 400 | | 10 | 20 | | 40 | | | 15 | | 16 | |
5
6087
by: trig | last post by:
Please help! I am an ICT teacher at a secondary school and my year 12 (AS Level) group need to create a website where data can be sent from a form to a Microsoft Access database. I am trying to do this in my own time and then hopefully teach them how to do it. I have installed IIS on my machine and have followed a few web
4
2489
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code m_Token = null in order to destroy the session token when the user logs out. However, I'm finding that setting class instance to null results in no header being sent back to the client, with the result that the client actually remains with an...
1
6862
by: maxxxxel | last post by:
Hi Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine. Our problem is that when we send mail externally to a internet email site like Gmail the PDF is sent but is corrupted because CDOSYS ends up using binary encoding rather than Base64 encoding when creating the attachment. More information here: Anthonys Code My knowledge of ASP...
2
2133
by: jcrum00 | last post by:
My asp script used to be able to send email to an unlimited amount of users. But a couple weeks ago I started getting this error message "transport failed to connect to server". So I increased the smtp connection timeout. Then I started getting an error saying the maximum amount of time for my script to run had been reached. So I increased Sever.ScriptTimeout. Now I'm just getting a generic error message saying my page cannot be...
0
9602
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10383
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
10120
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
9200
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...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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.