Skip to main content

Text field values

I'm trying change the "value" attribute of some text fields on my site. 

The code I'm trying to get at:

<input class="text" id="signup_email" name="signup[email]" type="text" value="TRYING TO CHANGE THIS">

Problem is I'm not sure which file to edit to change this, and haven't been able to find it.

Anyone able to point me in the right direction?

Thanks!

Official response from

Hello Taylor, 

You can do this in a couple of ways. 

1. Using liquid in the template. For example, in the signup page template you will find the liquid tag for this input:

<td><label for="signup_email">Email</label><br>{% text_field "email", class:"text" %}</td>

Here you can add a value to the tag using: value:"XX"

{% text_field "email", class:"text", value:"XX" %}

Which will in turn render:

<input class="text" id="signup_email" name="signup[email]" type="text" value="XX">

 

2. Using javascript in the template. For example, pasting the following will also change the default input value in the field:

<script>
$(document).ready(function() {
$("#signup_email").DefaultValue("XX");
});
</script>

Which will in turn render:

<input class="text" id="signup_email" name="signup[email]" type="text" value="XX">

Share this post

Showing 1 reaction

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.
Back to top