By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

Pick List Functionality

P: n/a
I'm using a DHTML dialog to present a pick-list to a user.
I've got the dialog working using some client side vbscript with a
call to window.ShowModalDialog.

I can see that the result is being returned to the main form, but I can't
figure out how to get it into the textbox the user is trying to populate.
The textbox is a server control. I tried setting the Text property of the
textbox to the result of the
dialog, but it just errors out claiming that an object is required.

Thoughts and ideas...? Please?

Jerry
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi, Jerry Camel,

Your problem should be solved completely on the client side.

Pass the document object when calling ShowModalDialog and then access it to
modify the value of the textbox:

showModalDialog("some.aspx", document, ...)

After that (in the modal dialog):

dialogArguments.forms[0].Textbox1.value = ...

The code is in javascript, but in vbscript you should only replace the []
with () and it will work.

Hope this helps
Martin
"Jerry Camel" <rl*****@msn.com> wrote in message
news:ue*************@TK2MSFTNGP10.phx.gbl...
I'm using a DHTML dialog to present a pick-list to a user.
I've got the dialog working using some client side vbscript with a
call to window.ShowModalDialog.

I can see that the result is being returned to the main form, but I can't
figure out how to get it into the textbox the user is trying to populate.
The textbox is a server control. I tried setting the Text property of the
textbox to the result of the
dialog, but it just errors out claiming that an object is required.

Thoughts and ideas...? Please?

Jerry

Nov 18 '05 #2

P: n/a
Thank you, Martin - Got exactly what I needed from that.

"Martin Dechev" <de*******@hotmail.com> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
Hi, Jerry Camel,

Your problem should be solved completely on the client side.

Pass the document object when calling ShowModalDialog and then access it to modify the value of the textbox:

showModalDialog("some.aspx", document, ...)

After that (in the modal dialog):

dialogArguments.forms[0].Textbox1.value = ...

The code is in javascript, but in vbscript you should only replace the []
with () and it will work.

Hope this helps
Martin
"Jerry Camel" <rl*****@msn.com> wrote in message
news:ue*************@TK2MSFTNGP10.phx.gbl...
I'm using a DHTML dialog to present a pick-list to a user.
I've got the dialog working using some client side vbscript with a
call to window.ShowModalDialog.

I can see that the result is being returned to the main form, but I can't figure out how to get it into the textbox the user is trying to populate. The textbox is a server control. I tried setting the Text property of the textbox to the result of the
dialog, but it just errors out claiming that an object is required.

Thoughts and ideas...? Please?

Jerry


Nov 18 '05 #3

P: n/a
Alright... Now I'm just confused.

Simple testing:
This worked just fine in testing when I set the return value equal to a hard
coded string. But when I try to set the return value equal to the value of
a textbox on the dialog form, nothing seems to get back to the original
form. No error, just no result returned.

Problems with more detailed testing included buttons, etc. that would cause
a postback of the dialog form: When the postback occurred, I ended up with
a third IE window with a duplicate of the dialog. What's happening?

Thanks

Jerry

"Martin Dechev" <de*******@hotmail.com> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
Hi, Jerry Camel,

Your problem should be solved completely on the client side.

Pass the document object when calling ShowModalDialog and then access it to modify the value of the textbox:

showModalDialog("some.aspx", document, ...)

After that (in the modal dialog):

dialogArguments.forms[0].Textbox1.value = ...

The code is in javascript, but in vbscript you should only replace the []
with () and it will work.

Hope this helps
Martin
"Jerry Camel" <rl*****@msn.com> wrote in message
news:ue*************@TK2MSFTNGP10.phx.gbl...
I'm using a DHTML dialog to present a pick-list to a user.
I've got the dialog working using some client side vbscript with a
call to window.ShowModalDialog.

I can see that the result is being returned to the main form, but I can't figure out how to get it into the textbox the user is trying to populate. The textbox is a server control. I tried setting the Text property of the textbox to the result of the
dialog, but it just errors out claiming that an object is required.

Thoughts and ideas...? Please?

Jerry


Nov 18 '05 #4

P: n/a
Hi, Jerry,

see inline ->

"Jerry Camel" <rl*****@msn.com> wrote in message
news:ea**************@tk2msftngp13.phx.gbl...
Alright... Now I'm just confused.

Simple testing:
This worked just fine in testing when I set the return value equal to a hard coded string. But when I try to set the return value equal to the value of a textbox on the dialog form, nothing seems to get back to the original
form. No error, just no result returned.
Most probably you don't reference the objects properly. Try alert-ing the
values until you find out the solution.
Problems with more detailed testing included buttons, etc. that would cause a postback of the dialog form: When the postback occurred, I ended up with a third IE window with a duplicate of the dialog. What's happening?
It is by design, I think (I haven't seen it documented though). All you have
to do is add the following tag in the head section of the html:

<base target="_self">

Other solution is to work in a frame or iframe thus posting inside it. It
requires more coding, but the titlebar text doesn't change after a postback.
It does change in the first solution.

Greetings
Martin

Thanks

Jerry

"Martin Dechev" <de*******@hotmail.com> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
Hi, Jerry Camel,

Your problem should be solved completely on the client side.

Pass the document object when calling ShowModalDialog and then access it

to
modify the value of the textbox:

showModalDialog("some.aspx", document, ...)

After that (in the modal dialog):

dialogArguments.forms[0].Textbox1.value = ...

The code is in javascript, but in vbscript you should only replace the []
with () and it will work.

Hope this helps
Martin
"Jerry Camel" <rl*****@msn.com> wrote in message
news:ue*************@TK2MSFTNGP10.phx.gbl...
I'm using a DHTML dialog to present a pick-list to a user.
I've got the dialog working using some client side vbscript with a
call to window.ShowModalDialog.

I can see that the result is being returned to the main form, but I

can't figure out how to get it into the textbox the user is trying to populate. The textbox is a server control. I tried setting the Text property of the textbox to the result of the
dialog, but it just errors out claiming that an object is required.

Thoughts and ideas...? Please?

Jerry



Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.