On Thu, 27 Jan 2005 16:37:52 -0500, Erik Weber <[EMAIL PROTECTED]> wrote:
> Since a JavaScript function can return any type of value, including a
> String, why can't you just write a function that returns the value of
> userField1? Perhaps within the a tag, you could call a function that
> generates the entire href, using concatenation?
> 

Yes, generating the entire href is what keeps going through my mind,
but all I could think of was something like href=" <%= beginning
string %> + javascript + <%= ending string %>"  which didn't seem
quite right. Having javascript generate the whole thing or passing
everything to a function that will build the url and open the window
is probably what I'll do.
Thanks for your comments. 

> Sorry if I'm not understanding the problem correctly.
> 
> Erik
> 
> 
> Susan Bradeen wrote:
> 
> >In a form on a JSP I have input text boxes, one with a link beside it
> >that opens a field value selector window.
> >
> ><html:text property="userField1" />
> >
> ><html:text property="userField2" />
> ><a href="javascript:window.open('
> >   <html:rewrite page="/promptUserField.do?parent=XXX"
> >            name="requestform"  property="udf2Map" />');">
> >   <img src="<html:rewrite page='/images/inspect.gif' />" ></a>
> >
> >With the link parameter hard coded as "parent=XXX", this works
> >perfectly. However, I need to pass the current value of "userField1"
> >as the parent value to the promptUserField action. Basically, instead
> >of "parent=XXX", I need
> >"parent=document.requestform.userField1.value".
> >
> >Now, this doesn't seem that tough, but I am drawing a huge blank on a
> >solution. Javascript retrieves the current field value, but then what?
> >Is it possible to combine scriptlets and javascript to build that page
> >attribute? I just don't see how.
> >
> >I can put an onchange event in the userField1 tag to update a hidden
> >field or requestform field. But would that help me? I am already
> >passing a map for parameters. I can't tack on another single
> >requestform parameter using the tag attributes that Struts could
> >access automatically.
> >
> >I am not coming up with an idea as to how to put this together. Can
> >someone just point me in the right direction?
> >
> >Thanks,
> >Susan
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to