I want to create a simple html form. Form contain two text box. First one is for typing in English and the second for the corresponding Arabic. How can I do that?
Thanks in Advance.
I want to type both English and Arabic without changing keyboard like google translator.
<form>
<input>
<input dir="rtl">
</form>
Related
I am using angular 4 for my front end.My project consist of many components and each component consist of forms and inputs.
Is there any way to convert each and every letter user entered to my input fields to capital letters.
I think previous answers will not match my project as I'm having hundreds of input fields I am looking for a easy way to convert every inputs to capital when the user enter.
Thanks in advance
While binding the expression in view you can use toUpperCase() function
Try this
<hello name="{{name.toUpperCase() }}"></hello>
<input type="text" [(ngModel)]="name">
Here is the working solution
You can use simple css code to convert it.
Selector{
text-transform:uppercase;
}
I have an HTML5 text field for given name (first name).
<input name="name" id="name" autocompletetype="given-name" type="text" alt="" maxlength="16" required/>
Some users put password here. Thus I want to prevent some of them by not allowing numbers. How I'll accomplish this? So, I want only English and Turkish letters plus - and ' for any case, oh and these â,Â,ê.. for any case. Better way is not to allow numbers I guess but is there such way?
I'm going to assume that you can use javascript/jQuery.
Please note that I am unsure if the letter sequence below covers only turkish letters/all turkish letters. However, it is a pretty exhaustive list of letters used in various languages.
Then:
$('#name').on('change', function(){
if(/^[a-zA-Z\- ’'‘ÆÐƎƏƐƔIJŊŒẞÞǷȜæðǝəɛɣijŋœĸſßþƿȝĄƁÇĐƊĘĦĮƘŁØƠŞȘŢȚŦŲƯY̨Ƴąɓçđɗęħįƙłøơşșţțŧųưy̨ƴÁÀÂÄǍĂĀÃÅǺĄÆǼǢƁĆĊĈČÇĎḌĐƊÐÉÈĖÊËĚĔĒĘẸƎƏƐĠĜǦĞĢƔáàâäǎăāãåǻąæǽǣɓćċĉčçďḍđɗðéèėêëěĕēęẹǝəɛġĝǧğģɣĤḤĦIÍÌİÎÏǏĬĪĨĮỊIJĴĶƘĹĻŁĽĿʼNŃN̈ŇÑŅŊÓÒÔÖǑŎŌÕŐỌØǾƠŒĥḥħıíìiîïǐĭīĩįịijĵķƙĸĺļłľŀʼnńn̈ňñņŋóòôöǒŏōõőọøǿơœŔŘŖŚŜŠŞȘṢẞŤŢṬŦÞÚÙÛÜǓŬŪŨŰŮŲỤƯẂẀŴẄǷÝỲŶŸȲỸƳŹŻŽẒŕřŗſśŝšşșṣßťţṭŧþúùûüǔŭūũűůųụưẃẁŵẅƿýỳŷÿȳỹƴźżžẓ]$/.test($(this).val())){
$(this).removeClass('invalidField');
$(this).addClass('validField');
} else {
$(this).addClass('invalidField');
$(this).removeClass('validField');
}
});
And then use CSS to mark fields valid/invalid. (A red border for invalid fields for instance)
I have a Textbox:
Now i want to highlight specific characters in this textbox with a colour. (for example "Text")
Is this possible?
Use ajax/jQuery for highlighting particular selected words in a textarea while writing words.
Check this link- http://bytes.com/topic/javascript/answers/820173-highlighting-searched-word-text-area
There is another way without using Javascript to place a text on a textbox. But the text will be ash all the time. There is a tag name "placeholder" on HTML. That may help
<input type="text" placeholder="text" name="inputbox">
My application has a form with 2 submit buttons:
<input name="rating" class="Show" type="submit" value="Show answer">
<input name="rating" class="Skip" type="submit" value="Skip">
However I noticed some errors in GAE logs:
ValueError: invalid literal for int() with base 10: 'Voir la r\xe9ponse'
ValueError: invalid literal for int() with base 10: 'Sauter'
Basically it's the value of the form buttons, in French, whereas my app is in English.
How can a user change the form submit values? For example with google translate etc?
How can I handle this?
Yeah, that'll be Google Translate. It translates the text on the buttons as well. If you really want to prevent this, you'll have to make sure Google can't translate the text on the button. Note: these answers are not semantic HTML. Not sure if there's a cleaner method, I hope so, but this is what first springs to mind:
Method 1: hidden inputs
Since you're using buttons anyway, you might as well have them submit something. Put each button in its own form, add a hidden field, and use the value of the hidden field to determine what page to load next.
Downside: a lot of extra html, not really maintenance-friendly
Method 2: numeric value
Change the value of the buttons into something numeric, like 0 and 1. Hide the button's value with CSS and give the button a background image that shows the text. Load the page based on the numeric value.
Downside: very bad accessibility (screen readers, etc.), text on button won't be translated.
I really do hope there's better alternatives I haven't thought of yet.
Can anyone please help me with this? I want to know how to store text in database with the tags. For example, if the text is bold, italics, underlined, justification, paragraphs, space etc., then even that must be retrieved and displayed in the textarea of the jsp page. Please help me out!
use function getTag("id_of_tag") to get tag.
attached its value and save it to database.Later retrieve it and show in view.
Create a field in database with datatype Text
Use some javascript text-area such as tinymce so that user can enter the text bold, italic etc.
Save the field with proper sql injectioning after form submission.