Razor- how to display message box? - razor

I am new to Razor. My application is not MVC.
What I am trying to achieve is to inform user that posting data to database was successful.
I do not want to re-direct user, all I want is to display a good looking message box.
I made quite a lot of research and I found these:
System.Web.HttpContext.Current.Response.Write("<SCRIPT> alert('Hello this is an Alert')</SCRIPT>");
and this
Response.Write("<script>alert('Message');</script>");
They both display message but a very bad looking one.
Question:
How to display a good looking message box using razor syntax?
Thank you!

This is the default browser message box, you can't style it.
If you want a nice looking message you need to style a custom one using html/css/JavaScript.
E.g. you could use a jquery-ui see jquery-ui dialog

You cant.
My preference is ALERTIFY JS

Related

How to create a HTML5 tag input

for my HTML5 web application (PHP) I need some input widget for tags like many modern tools have them. For example here a screenshot of Jira label list:
No idea how this widget type is named. I thought maybe it's possible to style with a HTML5 form? Any ideas? I tried to search in goggle, but "tag" and "html" together is a bad search combination. :-)
Hmmm, I just found out by reverse engineering the code of this web page from the tags input below I get some ideas...
But does anyone know an easier example?
enter image description here
You can use jquery autocompleter:
https://jqueryui.com/autocomplete/
And style it whatever you want

Inserting or copy/pasting picture to a textbox

I have a file with a textarea (named "Resolution support") in which you can explain how to solve a problem. My problem is that a user would be able to add a picture for a better explaining. If he copy/paste or he has to click and drag or anything i don't care, he HAS TO be able to put a picture into the textarea.
I wondered if another textbox that can do this would exist and what Type does the textbox has to be in PhpMyAdmin.
My textarea :
<textarea name="Escalade" class="longInput" cols="80%" rows="19" wrap="hard">
</textarea>
Without some kind of JavaScript WYSIWYG library this is not possible as vanilla textarea only takes text (clue is in the name).
I assume that you are viewing the submissions in phpMyAdmin which is an interface onto a MySQL database. It is good for developing stuff but not so great as an admin user interface long term. What you are asking about are called transformations.
Here are some tutorials on storing images in a database:
http://www.hockinson.com/programmer-web-designer-denver-co-usa.php?s=47
http://w3schools.invisionzone.com/index.php?showtopic=48068
How to store file name in database, with other info while uploading image to server using PHP?
Here are some lists of WYSIWYG editors:
http://www.sitepoint.com/html5-wysiwyg/
https://github.com/cheeaun/mooeditable/wiki/Javascript-WYSIWYG-editors
Those phpMyAdmin transformations:
http://docs.phpmyadmin.net/en/latest/transformations.html
That is about as much help as can be offered to you without seeing the PHP code behind the form at the very least. Hope this helps.
If someone is looking for an answer, I had asked my profesor and he answered that what I was looking for is a "Rich Text Editor". I'm using ckeditor with the plugin prgfilemanager. It allows me to insert pictures but I cannot copy/paste them which is pretty annoying...
You can try it here http://ckeditor.com/demo I hope it will help you if you have the same problem that I had :)
While it is true that you cannot use a textarea, the answer is very simple. You can use a content editable div, grab the contents as html and write it to a databae using AJAX and PHP.
Just name a div like this:
<div class="my_article" contenteditable></div>
and pass the contents on the click of a button into a JS variable and then pass that into PHP using AJAX.
var content1 = $('.my_article').html();
If anyone needs further help please comment and I'll be happy to obligue.

Gmod Lua Coding - How to place an HTML5 Page (Website) Inside of a Box

I've been working with a friend and we both have a problem, in a Garry's Mod Server, ok so we have a box saying Rules, and when we go to place a website INSIDE OF THAT BOX, it shows exactly this:
http://cloud-4.steamusercontent.com/ugc/37489242708029141/B4E51CC2F089F13DF25AA8F4F3E9BF7A07619427/
As you can see, it shows a box with the HTML5 coding, not sure if I can place:
http://www.sparkperp.com/Rules/index.html on that box.
I would like to know how to do that, if it's possible.
Thanks for your help
Please give your code in the future. Since I'm unable to view your code I'm limited in how much I can help, but I will try my best anyway!
You need to use the HTML vgui element vgui.Create("HTML") and use :OpenURL(weblink) on it. You can also use :SetHTML(htmlstring) if required. You should get the idea from the below code block:
local MOTD = vgui.Create( "HTML", parent )
MOTD:OpenURL("http://www.sparkperp.com/Rules/index.html")
If you can't get it working, update your question with your code and I'll be able to help further.

Why can't I add an HTML custom attribute to a visualforce page?

I have an control, to which I want to add a custom html attribute called, previousValue.
The Salesforce Developer's Guide assures me that I can do this by prefixing the attribute name with html-.
So I have an element that appears thus:. I also have the docType="html-5.0" attribute in my page control.
However, in Eclipse I get an 'unsupported attribute' error. I have upgraded to the latest force.com IDE; can any one tell me why this isn't working? What else do I need to do?
Thanks.
After much experimentation, the answer to this seems to be that the salesforce developer's guide is inaccurate and the 'hmtl-' prefix is not supported by the <apex:inputField> component. I can add it without a problem to an <apex:outputPanel> component. Don't understand why this should be so and the whole point to using these attributes is to locate data in a relevant place and avoid complex jquery selects to find the data relative to the location at which it is required.

Implementing autocomplete in HTML input

I devise a web site. I am using PHP, XML and HTML. There is input forms in my HTML files and I want to implement auto-suggestion in input forms.
When you enter search phrase to google's input form, many suggestions appeared in your browser. I exactly want to implement this.
What must I do? Which language/interface/information I need to?
thanks in advance.
Autocomplete is done via JavaScript. Check out the jQuery Autocomplete plugin for a pretty easily library to get started with. You can either include the values to be used for autocomplete in the JavaScript, or you can make an AJAX request to a PHP script which provides suggestions. Feel free to comment if you'd like more help.
This will be the easiest way to get it done...
http://jqueryui.com/demos/autocomplete/
JQuery UI is a javascript framework that has a nice autocomplete implementation: http://jqueryui.com/demos/autocomplete/
Of course you will need the jquery and jquery ui javascript frameworks.