Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Prefill Form Field - Form Builder Rate Topic   - - - - -

 
  • djhamer
  • Newbie
  • Members
  • Join Date: 31-Oct 13
  • 12 posts

Posted 10 February 2014 - 05:04 PM #1

I have created a technical support survey form. I'm using OSTicket for my tech support ticketing system.

I want to pre fill one item in my form (Ticket Number). I know this is normally done in the URL but I cannot seem to get the URL code correct.

Here is the URL with the code I'm trying to use:
http://www.vertical-...Ticket%#=998759

The original page url is:
http://www.vertical-...view&page_id=50

Is there anyone that can help me understand what I'm doing wrong? I have tried using the label "elm_240" and also "form_values[240] in place of "Ticket%#".

Here are the form properties from the code:
<label for="elm_240" class="cm-required ">Ticket</label>
						    <input id="elm_240" class="input-text" size="50" type="text" name="form_values[240]" value="" />

Thanks so much in advance if you can assist!

 
  • amdowney
  • Senior Member
  • Members
  • Join Date: 22-Oct 14
  • 243 posts

Posted 23 July 2015 - 05:17 PM #2

I'm trying to create a link to a form from a product which when clicked auto fills in the product name in the form, how can this be done?
Stores: CCTV Kits & www.jmtb.co.uk

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11327 posts

Posted 24 July 2015 - 02:41 AM #3

Try some jQuery like:
]code]<script type="text/javascript">$('#elm_240).val('your value');</script>[/code]

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19478 posts

Posted 24 July 2015 - 09:02 AM #4

If you can add product_id to the URL, use

<script type="text/javascript">$('#elm_240).val('{$smarty.request.product_id|fn_get_product_name|fn_js_escape}');</script>

where elm_240 is the ID of the required text input

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.