Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate field with a button

Status
Not open for further replies.

mikelev

Technical User
Mar 23, 2004
223
US
Hello all,

2 questions:


I have the following line in my JSP. I would like a button to populate the directoryname with "C:\DataLoad\Error

Code:
<psdi:textinput label="Log Directory:"		size="20"		      gridrow="1" gridcol="5"			mbosetid="rec"		mboattribute="directoryname" />


The second piece is to create a button that opens a text file (it is always a .txt file) for the following line:

Code:
<psdi:textinput label="File Path:"	size="40"			gridrow="1" gridcol="2"			mbosetid="rec"		mboattribute="textfilename"/>


many thanks in advance....

 

Are you confusing Java and JavaScript?

For the first question, does the code you posted bear any relevance to the question? For the second, how do you "open a text file for a line of code"?

Open a file for a line? Huh?

Can you clarify what you mean, please?

Dan



[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Sorry Dan,

I am very new to JS. This is a canned product that I am trying to modify. The method (Java or JS) for populating the directoryname makes no difference to me, I just thought that JS would be easiest. I posted the existing JSP code just in case it was helpfull.

I would like to populate the directoryname with the value "C:\DataLoad\Error" so users do not have to type the value in every time. Instead they can click a button (i hope) to avoid excess typing and typo's.


The second is a button to open the file listed in the textfilename field. this is so that users can open the file listed directly without navigating to the file with windows explorer and opening it.

Hope this clears up my earlier post?

Cheers
 
To populate a default value in a regular text field (I have to assume that this is what you are talking about), you don't need JavaScript. You can do it when the page is delivered:

Code:
<input type="text" name="someName" value="C:\DataLoad\Error" />

The second point you should be able to do by either opening the file in a new window (window.open), the same window (window.location) or modifying / adding an anchor element (a href=...).

If that doesn't help, you would need to show the client-side source (use the "view source" function of your browser). What you are showing looks like some sort of tag library.

Hope this helps,
Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top