• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

trying to populate hidden field on my JSF form using jQuery

 
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have some jQuery code whereby I am trying to set the SELECTED option in my dropdown list in a hidden field in the form. Per the code below, when I enter the value in the toAccountNumber field I run a query based on the first 2 characters entered in that field and then select the option that matches in my dropdown.

I want to populated the selected value in a hidden field before I disable the dropdown so that I can pass the hidden field value to my bean however, after the jQuery code completes I went to the view source and the hidden field value was not populated. I am assuming that I should see the value in the hidden field when the jQuery code completes, is that correct?

Any help/direction would be appreciated. Thank you.

BTW, I had used as an example a jQuery user's post on this URL to help me but I'm using blur and not click as the event to act on and it seems like it should work but it is not and I'm assuming I may have a syntax issue(?):

http://jsfiddle.net/charlietfl/5u3BZ/

Here is my jQuery code:



Here is my HTML for the hidden field on my JSF form:

 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was finally able a value returned from the selectedFacilityCodeID in my dropdown. However, I'm still not able to populate the hidden field in my JSF form.

Here is the modified code but again cannot get the hidden field populated:



Hidden field in HTML:



Any suggestions? Surely this can't be this difficult. Thanks.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the JSF forum as the code examples have JSF tags.
 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My problem was a syntax issue. Finally got it working. The correct syntax was:

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic