Jump to content

How to copy what user types in one text field to the other?


Ryan Thomas

Recommended Posts

Hey everyone,

 

I am trying to accomplish something that should be simple but need your help.  This is what I'm looking to do:

 

When person types "Subaru" in related listing field (which is the related listing title of course), Jreviews needs to auto-populate another standard click2search field with the exact same text "Subaru". 

 

So, each listing would have two fields with the same text: 1) a related listing field (in this example called "Subaru") and 2) a regular click2search field (also called "Subaru" since that is the text that was typed into the related field).  To summarize: the click2search field would have the same text that the user entered into the related listing field.

 

So, if you look at Jreview's code below, when I user types in the input that has the class "acInstructions jrAutoSuggest ui-autocomplete-input", it will need to copy that exact text over to the input named "data[Field][Listing][jr_testfield]"

 

<input style="display: none;" name="data[Field][Listing][jr_carmanufacturer]" class="jr_carmanufacturer jrRelatedListing" data-click2add="0" data-listingtype="1" type="text">

<input aria-haspopup="true" aria-autocomplete="list" role="textbox" autocomplete="off" class="acInstructions jrAutoSuggest ui-autocomplete-input" type="text">

<div class="jrRelatedListingSelected"><input style="display: none;" checked="checked" class="jrLeft" type="checkbox"><span class="jrRelatedListingTitle"></span></div></div>

<input name="data[Field][Listing][jr_testfield]" class="jr_testfield jrText" data-click2add="0" type="text">

 

Is there anyone who can help me achieve this? 

 

Thanks for your help in advance!

Link to comment
×
×
  • Create New...