Results 1 to 2 of 2

Thread: Should be an easy fix, but...

  1. #1
    Join Date
    Oct 2012

    Should be an easy fix, but...

    Guys I have a form that uses a simple javascript to get a value from the picklist, then replace the value in an input field so that when submit is clicked, it sends the correct information to the server. My issue is that I had this working and not it isn't for some reason. Maybe one of you can help me see an error I made.

    the script:
    $(function() {
    $("#display_value option").click(function(){


    The relevant form data:

    <form name="Booking" action="form/capture.php" method="post" accept-charset="utf-8">
    <input id="get_value" type="hidden" name="publicid" value="" />
    <input type="hidden" name="name" value="Booking"/>

    <table width="100%">
    <td align="right"><label >Who is your agent?</label></td>
    <select name="label:Agent[]" required="true" id="display_value">
    <option value="e023f0f7">Please Choose</option>
    <option value="ec4d03d7">Philly</option>
    <option value="a80bf9d9">Kirk</option>
    <option value="96c6e63b">Jonah</option>
    <option value="38bc0bcf">Ken</option>

    As you can see above, the input "publicid" is supposed to grab the value from the pick-list based on the option chosen. The pick-list is id "display_value" and the input is id "get_value". What am I missing???

    If I put the value from the option in the input field (for example "e023f0f7") into the value of the input field (such as value="e023f0f7"), the form saves the information to the correct place so I know that the script is the issue.


  2. #2
    Join Date
    Aug 2008
    I can't really see anything wrong... Try alerting what $("#display_value").val() is inside your click event handler.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center