Jump to content

Placing cursor in field and selecting entire field


RoadrunnerRay
 Share

This topic is 6424 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a Log-0n page defined with a field for the user to enter data. I would like the entire contents of the Participant IDQ field to be selected when the user selects the web page. The form I am using is defined below. Any assistance will be much appreciated.

===============================================================

<form action="FMPro" method="post">

<input type="hidden" name="-db" value="Web_TA_Participant_DB.fp5">

<input type="hidden" name="-lay" value="Participant Form Part-2">

<input type="hidden" name="-format" value="verify_data.htm">

<input type="hidden" name="Participant IDQ" value="==">

<input type="hidden" name="-error" value="log_on_error.htm">

<div align="center">

<p><font size="+1"><input type="text" name="Participant IDQ" value="samplenmsu.edu" size=40></font></p>

</div>

<div align="center">

<input type="submit" name="-find" value="Log-In"></div>

Link to comment
Share on other sites

form fields in FM and HTML are compleatly different and "selected on load of page" does not really apply....the question is why would u need the field's content selected? What do u intend to do? Some javascript might be of use but u need write more about the goal of all this....

take care!

Link to comment
Share on other sites

Hey Rey!

Mr. Unbale already gave you the idea of "hidden field" that will also be inculded/submitted with your form -hidden= holds a value that is not entered by a user.

Consider maybe using a checkbox with some value assigned if u just want to record infomation by a click.

Now, I am not quite following the expression:

"the only reason is to save the user a click into this field"

did u mean to say to record 'user name/user ID' or "user's selection out of many options offered" when he clicks?

..again, like Unable said if your "user" is ALWAYS going to be "samplemsu.edu"

then instead of using

<input type="text" name="Participant IDQ" value="samplenmsu.edu" size=40>


and having user type their name...use hidden field:


<input name="UserName" type="hidden" value="samplesome.edu">

Sorry if I wrote more than neccessary....I dont know your HTML skils....post more if u need help or better yet give us a link to your page -if possible.

Take care!

Link to comment
Share on other sites

Thanks to all who offered help on this thread! I originally set up this database to be used over our university network and as an after thought decided to put it out to cyberspace. My background is heavy in DB design/development and VERY light in web site design/development.

Sorry for not being more specific with regard to the problem definition. I wanted the cursor to appear in the Participant IDQ field when the page was selected by the user. It appears that Garry has come up with the solution I was looking for (not tested yet). I bought a book on Java Script and can now see the overwhelming benefit it can provide.

I will be back to let you all know the results of this suggestion, again, many thanks for the effort you all put forward to assisting me with this question....... Ray

FileMaker Version: 6

Platform: Mac OS X Jaguar

Link to comment
Share on other sites

  • 2 weeks later...

Morning Garry, finally had an opportunity to try your suggested Javascript after my form. Unfortunately, it did not place the cursor in the Participant IDQ field. Does this Javascript execute when the page is displayed? Do I have to indicate that it is Javascript?

Many thanks, Ray

Link to comment
Share on other sites

The Javascript should perform as the page is loading. Hence, it needs to be placed after the </form> tag.

The Javascript can also be used with the "onload" parameter of the <body> tag. For example:

<body onload="document.loginForm.elements['Participant IDQ'].focus();">

Good Luck.

Garry

Link to comment
Share on other sites

  • 3 weeks later...

Thanks to all who rendered suggestions here, I have tried using both the "onLoad" and javascript recommendations from Garry and Leb i Sol (link) with no success. I do not get errors when loading the page but the cursor does not appear in the field...

I have another hurdle to address for this application which has more priority at the moment and will be asking a question in another area of the forum......

Link to comment
Share on other sites

  • 4 weeks later...

Found some time to revisit this problem. The form has changed a bit so I am going to post the new definition below:

<form action="FMPro" method="post" name="LogInForm">

<p><input type="hidden" name="-db" value="Web_TA_Participant_DB.fp5"></p>

<p><input type="hidden" name="-lay" value="Participant Form Part-2"></p>

<p><input type="hidden" name="-format" value="verify_data.htm"></p>

<!-- The Name Value="==" insures that when a search is done on

Name an exact match will be the only result. This Value must preceed the

Name text box line or an error will occur when doing the search -->

<p><input type="hidden" name="User ID" value="=="></p>

<div align="center">

<p><font size="+2"><input type="text" name="User ID" value="" size=30></font><p>

</div>

<div align="left">

<p><input type="hidden" name="-error" value="log_on_error.htm"></p>

</div>

<div align="center">

<input type="submit" name="-find" value="Log-In"></div>

</form>

I am using the onLoad function in the <Body> tag as follows:

<body onload="document.LogInForm.User ID.focus()" bgcolor="#ffffff" link="#990033"

Link to comment
Share on other sites

Hi Garry, I implemented your suggestion in the log-in page and still did not have a cursor in the log-in field. Since I was not going to give up this time around I dug in my heels and went a little further. I removed the following line of code:

<p><input type="hidden" name="User ID" value="=="></p>

Then tried your suggestion again and it worked like a charm. I still need the above line of code (which you were also kind enough to give me) to assure that I only get exact matches in my search. Do you have any suggestions for getting around this problem??

Link to comment
Share on other sites

This topic is 6424 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.