Starting from the input with the class "update-button"
in the next to the bottom line of the HTML/CFML below,
I'm trying to traverse one line up to the input with two
classes, the second being the important one, "update-input".

I've tried using:
$('.update-button).parent().next('.update-input').attr('value').val()
to get the form field input placed into the field by the user.  In other words,
I'm trying to get the value the user puts into the field, which is the tour url.

The next value I need to send via ajax is top div's id value on the first
line below of the HTML/CFML.  It's the div with a class of "tour-info-div"
and I need it's id value, which is the mls_number.  The #mls_number# is a
ColdFusion variable.  For this one, I tried:
$('.update-button).parent().parent().attr('id').val()
but I was getting an error on that one.

I need to send those two values, the form field tour url user entry, and the
mls_number as values through the ajax function.

How would I write up these traversals?

Thanks for any help!

Rick

Here's the HTML/CFML:

<div id="#mls_number#" class="tour-info-div">
                                                                                
   <div id = "address_id_#mls_number#" style="width:300px; 
font-weight:bold;">#street_number#
#street_name#, #city#</div>
                                                                                
                
   <cfif not len(trim(#tour_url#))>
      <div class="no-tour">No Tour Available</div>
   <cfelse>
      <div class="tour-url">Current Tour: &nbsp; #tour_url#</div>
      <div class="options">
            [ <a href="#tour_url#" target="_blank">Preview</a> ] &nbsp;
            [ <a class="update-link" href='##'>Update</a> ] &nbsp;
            [ <a href= "##">Delete</a> ]
      </div>
   </cfif>
        

   <div class="update-div">
        

      <div>Edit Link:</div>
      <div><input class="textinput01 update-input" size="80" 
value="#tour_url#"></div>
      <div><input class="update-button" type="button" value="Update"></div>
        

   </div>

</div>

Reply via email to