LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-30-2004, 12:07 PM   #1
codec
Member
 
Registered: Sep 2003
Location: mad.es.eu
Distribution: ubuntu 5.04 knoppix Slack91/10 freebsd51 vector4 redhat9
Posts: 304

Rep: Reputation: 30
set focus on a text form of a web page?


I don't know how to write web page.

I am using the apache+mod_python method to replace my old console-style applications. It's working ok. However, it's crap because the focus isn't set to the text form. I would like to set focus on the text form, press a enter to send a request to the python module. Mouse click should be avoided. How can I do that?

<html>
Search bsp sales:
<p>
<form action="mydb.py/web_iatan" method="POST">
Agency: <input type="text" name="iata_n"><br>
<input type="submit">
</form>
</html>
 
Old 12-30-2004, 01:00 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
In the <body> tag which you have ommited for some reason - add:
onload="javascript:document.myform.iata_n.focus()"

Then in the <form> tag add:
name="myform"
 
Old 12-31-2004, 04:32 AM   #3
codec
Member
 
Registered: Sep 2003
Location: mad.es.eu
Distribution: ubuntu 5.04 knoppix Slack91/10 freebsd51 vector4 redhat9
Posts: 304

Original Poster
Rep: Reputation: 30
Thanks for the help. It work now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display a text file from hard drive into a web page EgosZ Linux - Networking 6 04-04-2005 10:51 PM
Unable to set focus to the user name field in login screen using keyboard alone Lindaramachandr Linux - General 3 12-29-2004 09:43 AM
Kicking off a script form a web page Hazzie Programming 2 04-26-2004 01:09 PM
HTML setting focus on a form element on load patpawlowski Programming 3 02-24-2004 10:01 AM
Jerky mouse when web browsers download web page stodge Linux - Software 1 07-08-2003 10:29 PM


All times are GMT -5. The time now is 07:46 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration