Skip Navigation

[Resolved] Convert input to uppercase

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 13 replies, has 2 voices.

Last updated by cristianR-3 7 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#504246

I am trying to: Input letters

I visited this URL:

I expected to see: MLK2233

Instead, I got: mlk2233

#504247

I attempted to write some JS that would convert the input values to uppercase, but it is not working. I was wondering if I could get some help.
What I need is, regardless of how the text is typed, I need it to be input in uppercase characters.

#504330

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Cristian,

Thank you for contacting our support forum.

Could you share with me your current code so that I can have a look ?

Thanks,
Shane

#504368
		<div class="cred-field cred-field-license-plate">
			<label class="cred-label">
                            License Plate #
                       </label>
			[cred_field field='license-plate' post='permit' value='' urlparam='']
		</div>
#504371

This would be the JS.

$('input[type=text]').val (function () {
    return this.value.toUpperCase();
})
#504387

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Christian,

Try this .

    [cred_field field='license-plate' class='license' post='permit' value='' urlparam='']

 jQuery(".license").val().toUpperCase()

Please let me know if this helps.
Thanks,
Shane

#504437

It didn't work. I think I need to trigger a function when the submit button is pressed that will covert the value to uppercase before submitting the data.

Any ideas?

#504480

So now this still does not work and another issue emerged. When I modify a child post with a Cred from, I was able to show the parent's post name with [cred_post_parent get='title']. Now it displays the short code and not the name.

Do I need to open a separate ticket for this new issue?

#504512

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Christian,

Try this.

jQuery( ".license" ).keyup(function() {
jQuery(".license").val().toUpperCase()
});

Also yes for your second issue a new ticket is recommended.

Thanks,
Shane

#504552

Ok, it seems the JS is not enabled. I even tried this. Wrapping it on a document ready function.

$(document).ready(function(){
	$('.submit-button').click(function(){
		alert('This got clicked');
	});
});
#504553

It is not running JQuery at all.

#504560

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Cristian,

For wordpress you won't be able to use the $ without declaring a function so I would changing the $ to jQuery.

Thanks,
Shane

#504571

Ok, I got it to work with this.

jQuery(document).ready(function(){})
jQuery('.license').keyup(function(){
	jQuery(this).val(jQuery(this).val().toUpperCase());
});
#504576

Thanks a lot for your help.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.