textbox autocomplete return value
-
- Profound User
- Posts: 38
- Joined: Wed Jul 19, 2017 4:54 am
- First Name: Nadine
- Last Name: Gauthier
- Company Name: CAPL
- Country: France
- Contact:
textbox autocomplete return value
Hi,
Is there a way to retrieve return data value from a textbox autocomplete with javascript (data return by "choice values field" to the server)
Thanks
Is there a way to retrieve return data value from a textbox autocomplete with javascript (data return by "choice values field" to the server)
Thanks
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: textbox autocomplete return value
The value in the textbox will be placed into whatever variable is bound to the 'value' property. This will be returned to the server when the screen is submitted.
Is that what you're asking?
Is that what you're asking?
-
- Profound User
- Posts: 38
- Joined: Wed Jul 19, 2017 4:54 am
- First Name: Nadine
- Last Name: Gauthier
- Company Name: CAPL
- Country: France
- Contact:
Re: textbox autocomplete return value
not exactly,
The value property appears on the screen but the value return to the server may be different.
example : appear on screen the name of articles but return the id of article selected
The value property appears on the screen but the value return to the server may be different.
example : appear on screen the name of articles but return the id of article selected
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: textbox autocomplete return value
Okay, I think I understand.
The "Choice Values Field" is returned in the "value" property. But, what is shown on the screen is the "Choice Options Field". You want the value on the screen (the value from the Choice Options Field) to be sent to your server-side program.
To do that, I would:
1) Create a textbox bound to a character field large enough to contain the entire "Choice Options Field".
2) Mark this textbox as "hidden" so the user cannot see it.
3) Set the ID of the hidden textbox to something that makes sense (I used id = "hiddenTextbox")
4) Make sure you know the ID of the "normal" textbox (the one that has autocomplete.)
5) In the "normal" textbox's "onselect" event code this:
The Onselect event runs when the user makes a choice from the auto complete list. So each time that happens, it gets the value that was selected in the normal textbox (the value you see on the screen) and sets the hidden textbox to that value. When the screen is submitted to the server, the server-side program can read the field that was bound to the hidden textbox to get the value.
The "Choice Values Field" is returned in the "value" property. But, what is shown on the screen is the "Choice Options Field". You want the value on the screen (the value from the Choice Options Field) to be sent to your server-side program.
To do that, I would:
1) Create a textbox bound to a character field large enough to contain the entire "Choice Options Field".
2) Mark this textbox as "hidden" so the user cannot see it.
3) Set the ID of the hidden textbox to something that makes sense (I used id = "hiddenTextbox")
4) Make sure you know the ID of the "normal" textbox (the one that has autocomplete.)
5) In the "normal" textbox's "onselect" event code this:
Code: Select all
pui.set("hiddenTextbox", pui.get("normalTextbox"));
-
- Profound User
- Posts: 38
- Joined: Wed Jul 19, 2017 4:54 am
- First Name: Nadine
- Last Name: Gauthier
- Company Name: CAPL
- Country: France
- Contact:
Re: textbox autocomplete return value
Hi,
In fact, i want to know if i can retrieve the textbox1.cl value of auto complete textbox by an official way.
Thanks.
In fact, i want to know if i can retrieve the textbox1.cl value of auto complete textbox by an official way.
Thanks.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: textbox autocomplete return value
Hello,
What do you mean by the "textbox1.cl value"? I'm not familiar with that.
-SK
What do you mean by the "textbox1.cl value"? I'm not familiar with that.
-SK
-
- Profound User
- Posts: 38
- Joined: Wed Jul 19, 2017 4:54 am
- First Name: Nadine
- Last Name: Gauthier
- Company Name: CAPL
- Country: France
- Contact:
Re: textbox autocomplete return value
Hello,
it's the value return when user select an item on list.
textbox1.cl.value represent data return by "choice values field" to the server.
it's the value return when user select an item on list.
textbox1.cl.value represent data return by "choice values field" to the server.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: textbox autocomplete return value
When the user selects an item on the list, the 'choice value' is placed in the 'value' property. This is already submitted to the server automatically.
With regards to the 'textbox1.cl' value. I assume based on your clarification that you are doing something like this?
Then, textbox1.cl looks like the value you need? I would strongly discourage you from using 'cl' in that case.
Profound UI uses a 'minify' type of tool to reduce the size of our JavaScript code. This makes it smaller, load faster, and use less memory. Minifying the code involves (amongst other things) changing the variables that we use internally into shorter names. These names are generated on-the-fly, and can be different each time it is minified.
In your case, I suspect its resulting in the name 'cl'. However, if you install a patch or update to the next version of Profound UI, it may have a completely different name. This means that with every update you make to Profound UI, you will have to change your code.
With regards to the 'textbox1.cl' value. I assume based on your clarification that you are doing something like this?
Code: Select all
var textbox1 = getObj("TextBox1");
Profound UI uses a 'minify' type of tool to reduce the size of our JavaScript code. This makes it smaller, load faster, and use less memory. Minifying the code involves (amongst other things) changing the variables that we use internally into shorter names. These names are generated on-the-fly, and can be different each time it is minified.
In your case, I suspect its resulting in the name 'cl'. However, if you install a patch or update to the next version of Profound UI, it may have a completely different name. This means that with every update you make to Profound UI, you will have to change your code.
-
- Profound User
- Posts: 38
- Joined: Wed Jul 19, 2017 4:54 am
- First Name: Nadine
- Last Name: Gauthier
- Company Name: CAPL
- Country: France
- Contact:
Re: textbox autocomplete return value
Scott Klement wrote:When the user selects an item on the list, the 'choice value' is placed in the 'value' property. This is already submitted to the server automatically. my answer : not necessarily, it can be different
With regards to the 'textbox1.cl' value. I assume based on your clarification that you are doing something like this?yesCode: Select all
var textbox1 = getObj("TextBox1");
Then, textbox1.cl looks like the value you need? I would strongly discourage you from using 'cl' in that case.
that's why i said officially
Profound UI uses a 'minify' type of tool to reduce the size of our JavaScript code. This makes it smaller, load faster, and use less memory. Minifying the code involves (amongst other things) changing the variables that we use internally into shorter names. These names are generated on-the-fly, and can be different each time it is minified.
In your case, I suspect its resulting in the name 'cl'. However, if you install a patch or update to the next version of Profound UI, it may have a completely different name. This means that with every update you make to Profound UI, you will have to change your code.
Who is online
Users browsing this forum: Bing [Bot] and 0 guests