|
You can use Javascript to perform this function. Here is the sample code.
This javascript function recives the event object and uses the keyCode property to check for character '13' which is a carriage return.It submits the form and returns false so when the user clicks enter, the carriage return is not added to the field. If it is not 13 then allow the character to be typed in.
<br />
function CheckForEnter(oEvent)<br />
{<br />
if(oEvent.keyCode=='13')<br />
{<br />
return false;<br />
myform.submit();<br />
<br />
}<br />
else<br />
{<br />
return true;<br />
}<br />
<br />
<br />
}<br />
here is the HTML for a textfield, use the keyonpress event so that way the event fires before the character is actually entered.:
<br />
<form id=myform action=test.aspx runat=server><br />
<input type=text id=txtTest onkeypress="return CheckForEnter(event);"><br />
</form><br />
thats all there is to it.
Jared Solomon
Programmer/Analyst
|
|
|
|
|
Thank you.I have to check it.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Sir,
i had developed html page there is lot of content and some button also display in that page. On Html page one print button is there. when i print html on paper it aslo print "button" also on paper.
I don't want to print "button" on paper. i want to print only content on paper.
How should i do that
Regard raju
|
|
|
|
|
Raju Pande MKCL Pune wrote:
I don't want to print "button" on paper. i want to print only content on paper.
CSS to the rescue! G'damn I love CSS.
Ok, but this only works on modern browsers so if your print needs to work on IE4 or Netscape 4 or earlier, then this won't work and you will have to create a totally seperate page without a button.
Basically you have two CSS files. One for the screen and one for printing. In your HTML page you code this:
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="css/print.css" />
So there you have reference two style sheets, and the media attribute tells your browser which one to use for which media, screen for on screen and print for printing. You can also specify mobile, braille, handheld etc. etc.
Then in your screen.css file you do this:
input{
display: block;
}
and in your print.css file you do this:
input{
display: none;
}
That display: none; tells the browser not to show the input element at all, and because it is in your print media CSS file, it won't show up on your printed page.
You can see an example of this at Zeldman's A List Apart site. Look at the page on your screen and then print it. You will see a big difference and that is because he has used print media and a screen media CSS files.
You can of course do this technique to any element on the page you do not want printed. Images, tables, divs etc. etc. You can also re-layout your page to print properly.
Hope that helps.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
|
|
|
|
|
I have a scenario: I have a table names DSAUsers that includes a user's User ID, First name, Last name, password, profile and email address.
What I want to do is:
SELECT email FROM DSAUsers WHERE profile = 'EQUIFAX'
I have several people with the EQUIFAX profile. I want to get all the email addresses and compile a string of them seperated by ";" so that I can include them on my CDONTS TO line. How the heck do I do this? I can get my string to write out to the screen by Response.Write, Movenext, Loop, but I can't get the thing to write to an object that I can use...HOW DO I DO THIS PLEASE???
|
|
|
|
|
Perhaps try something like this:
Within the recordset loop:
strEmail = strEmail & objRS("MyEmailField") & ";"
And after the loop:
' Get rid of the final ;
If strEmail <> "" Then
strEmail = Left(strEmail, Len(strEmail) - 1)
End If
Best regards,
J. Paul Schmidt - Freelance ASP Web Developer
http://www.Bullschmidt.com - To put live data on the Web...
|
|
|
|
|
This worked like a charm...I knew it would be something simple! Thanks a million for your help!!
Robby
|
|
|
|
|
Is there a way to fill out a web form by specifying values in the URL?
Johnny
|
|
|
|
|
You could use a querystring and the plug in the values from the querystring.
Example:
URL : http://www.yoursite.com?testparam=hello&testparam2=hello2
asp:
i hope this helps
Jared Solomon
Programmer/Analyst
|
|
|
|
|
Only if you're hosting the form and you can add code to parse the parameters and fill in the form.
Todd Smith
|
|
|
|
|
JohnnyNin wrote:
Is there a way to fill out a web form by specifying values in the URL?
I was going to reply that you can only do it via ASP (or some other server side language) and you would have to do it as Todd and Jared said above.
However I found this library which lets you use JavaScript to access the QueryString which is totally awesome: Using Query Strings from JavaScript[^]
The actual JS library file
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
|
|
|
|
|
I used Interdev to debug my asp page, but I can only debug server-script,
break point at client script code didn't work (it said that:"The break point
will not current be hit.The current document is not loaded", I'm sure that
it is loaded).
I read MSDN Library ,but I still can't solve this problem.
I hope to kick this trouble away with your help.
Thank you very much for your interest.
|
|
|
|
|
What version of Windows/IE do you have? Microsoft has a script debugger but depending on your config it may or may not be enabled by default. Just remember that you won't be able to use server objects all that well when debugging client code.
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
Hello!
My platform is Windows 2000 Server (IIS) and I'm attempting to make a small CGI-program using C++.
I'm able to receive arguments through argc/argv using url something like
www.mysite.com/somename.cgi?value
But if I'm trying to receive form data the url might look something like (if using GET-method) this: www.mysite.com/somename.cgi?variable=value
If the url contains a '='-sign my program doesn't receive any arguments. I've found tutorials on the web describing how to receive form data in PERL/Unix, but not for C/Windows.
So the CGI-newbie question is: How do I receive the data if the url has '='-sign? And if this is possible at all, is there any difference if the method is POST or GET?
I'm happy to read the ******* manual if you just point me where to start..
Thanks, Eero
P.S. I hope the only possible answer isn't "Use ISAPI"..
|
|
|
|
|
You need to access the HTTP environment variables and decode them.
Here's an example I like that'll get you started. It's called cgi-util and has wrapper functions in it to help you out.
Download
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
Ok, that wasn't very complicated. I made my own wrapper and it works like a dream.
Thanks!
--------------
Eero Kuutschin
|
|
|
|
|
Hello.
Does anyone have a script for a good search function, that doesn't need a Database?
I've downloaded every single one I could find but they were no good.
I want someting that will search all files in the root directory for a keyword/s and then display in the results
the sentence in which the keywords were found, or similar. Like Google does.
Or, if that can't be done, is there a way to automatically update a database with the site's contents?
because I don't want to have to go and update a database everytime I make changes to my site.
Cheers.
|
|
|
|
|
NathanScott wrote:
Like Google does.
You can always buy search services from Google. They even have an appliance which you plug into your network and it provides search results.
Also you could write a simple script in ASP.NET which uses the FileSystemWatcher component to automatically update the database when a file changes.
Apart from that, not many search engines which do not use a database.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
|
|
|
|
|
NathanScott wrote:
I want someting that will search all files in the root directory for a keyword/s and then display in the results
the sentence in which the keywords were found, or similar. Like Google does.
I think you might want to check into Microsoft Index Server. Chris wrote an article that shows how this works here[^].
HTH
Nick Parker
|
|
|
|
|
Does anyone know of a simple and free tool that will let me syncronise the files on my websites ftp server with my local drive (so if the file on the ftp server is newer, it downloads it to local, if the local file is newer it uploads it)
I've seen commercial and shareware offerings, but I just want something incredibly simple - it doesn't even need a gui
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
FrontPage will do that if you have it. If not, it would make a cool article. (I'm looking for an excuse anyway, and I haven’t' don't some sockets programming in a while. I'm missing it.)
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
Ack! no! I'm not letting frontpage anywhere near my site. What's the point in carefully handcrafting the HTML if it's going to decide that its way is better
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
benjymous wrote:
Ack! no! I'm not letting frontpage anywhere near my site.
My thoughts exactly. I just figured I'd let you know. You could use something like a versioning system - like CVS. But, the more I think about it, the more I want to make an article to simplify the whole process.
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
Is there not a free website publishing tool with Windows?
I seem to have seen an option to install something like that everytime I install Windows.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I have a radio button list in my ASP.NET application and it has three Item,I overriden its SelectedIndexChanged event,but it seems nothing happend when I change the index.Any idea?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|