By phacts on
Hello Drupal-World,
I'm altering the output of a form using hook_form_alter, and I've run into this problem before, and always found ways to side-step it. I figured, might as well put this out there, and see if anyone can shed any light on this. Anyway, here is the deal:
I want to use » as the value for my submit button. I've simplified the code below, so that you get the point.
<?php
function mymodule_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'finder_form_1') {
$form['submit']['#value'] = "»";
}
}
?>
This, of course, products & r a q u o ; as the value for my submit button (sans the spaces). No good! So, next I pasted the actual character into the code directly:
<?php
function mymodule_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'finder_form_1') {
$form['submit']['#value'] = "»";
}
}
?>
And this results in NOTHING showing up in the value field for the submit button.
Anyone run into this?
Comments
try unicode.
try unicode.
Thanks, and I feel stupid for
Thanks, and I feel stupid for asking this but... what would that look like?
It would be the number code
It would be the number code for the character. Also, you would have to set the webpage to display using unicode and not something else.
---
I have created and maintained countless Drupal-powered sites and have made heavy modifications to modules on a site-by-site basis. I am an illustrator, a game developer, and a web developer. I also stream on Twitch in my spare time.
Solution to » in $form['submit']['#value']
This should work:
http://jamesmorrish.co.uk/blog/using-raquo-in-a-submit-button-using-hook...