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

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 2417
In article <d1**********@reader11.wxs.nl>, triotours@*N0SPAM*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******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <d1**********@reader11.wxs.nl>, triotours@*N0SPAM*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**********@reader11.wxs.nl>, triotours@*N0SPAM*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 misunderstanding 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
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...
2
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
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
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...
1
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 | ...
5
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...
4
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...
1
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.