How to edit a JavaScript alert box title?




I'm generating a JavaScript alert with following code in C# .NET page:



```
Response.Write("<script language=JavaScript> alert('Hi select a valid date'); </script>");

```

It displays an alert box with the heading title as "Message from webpage".


Is it possible to modify the title?
No, you can't.


It's a security/anti-phishing feature.
> 
> i want to create ap application which generates popup alerts at the day of event ocurs as well as a day before the event will occur in a specific time interval as well.. events are stored in database and they are all date fields .. so i want to link those fields to create popups .. help me .
> 
> 
> 


In order to help you, you must first provide us with what you have achieved. We do not write code for you, simply correct and enlighten on mistakes. try this and try to modify accordingly -



```
<?
//content is the array of titles which comes from the content.php page or the entire code can be put in the content.php
$content = array('title1 - This is the Homepage','title2 -Find new friends','title3 - Get your visa cleared now','title4 - bark about your wife here','title5 - Dont have kids yet','some other page');

$arr = explode('/',$_SERVER['PHP_SELF']);

$current_page = $arr[count($arr)-1];
//list your pages here
$pages  = array("1=>index.php","2=>friends.php","3=>nicks.php","4=>rent.php","5=>test.php");
for($i = 0; $i<count($pages);$i++)
{
	if($pages[$i] == trim($current_page))
		$pages_index = $i;
	else $pages_index = 6;
}
//This will echo the title
echo $content[pages_index];
?>
```

ask,if you stuck up somewhere. Hi Avik,

Thank you for the quick response.

Kind Regards,

Arshath 




[View solution in original post](/t5/adobe-social-questions/creating-alerts/m-p/203573#M385) Hi Romain, 

  
  
You can use HTML formatting this way:

  
  

```
  
sender = scenario.get_message_sender(channel_id="my_channel_id")   
sender.set_params(sender="dss@company.com",   
                recipient="your.email@company.com",   
                sendAsHTML=True)  
                  
html_message="<b>All is good</b>"  
  
sender.send(subject="The scenario is doing well",   
            message=html_message)
```
  
  
 




[View solution in original post](/t5/Using-Dataiku/Is-it-possible-to-send-custom-reports-as-HTML/m-p/2194#M1517) Your function works, but both the IF and the ELSE return an alert message that says its invalid.  

The first part - the IF - should return in the alert box "Valid SSN"  

I am assuming your input should be like this 123-45-1234


but do you need to tell the user the input is valid? Surely the alert should only be displayed if the input is invalid? So the if should return nothing. imho May be the function is executed before the document is ready.
Try to use document.ready function like this:



```
$( document ).ready(function() {
    $('#machines').change(function() {
        var $selected = $(this).find(':selected');
        $('#description').html($selected.data('description'));
    }).trigger('change');
});

``` hi andy,  

  

could you please explain in more details what exactly you need to achieve, because i am still not sure i understand you correctly?  

  

please note that when you are using the code below, you are overriding the text of the selected item - in your case this is the first item in the radcombombobox(with the empty text):  


`ddlfuturecode.selecteditem.text =` `"futurecode"`

  

if you want to select an item from the radcombobox by its text, you can use the following code instead:  


`ddlfuturecode.finditembytext(``"futurecode"``).selected =` `true`

  

so the changed vb code should look like the following:  


`dim` `ddlfuturecode` `as` `new` `radcombobox`
 
`with` `ddlfuturecode`
`.items.clear()`
`.items.add(``new` `radcomboboxitem(``""``, 0))`
`.items.add(``new` `radcomboboxitem(``"1"``, 1))`
`.items.add(``new` `radcomboboxitem(``"futurecode"``, 2))`
`.databind()`
`end` `with`
 
`ddlfuturecode.finditembytext(``"futurecode"``).selected =` `true`
 
`form1.controls.add(ddlfuturecode)`

  

  

regards,  

 aneliya petkova   

telerik

do you want to have your say when we set our development plans?
do you want to know when a feature you care about is added or when a bug fixed?
explore the [telerik feedback portal](http://www.telerik.com/support/feedback)
and vote to affect the priority of the items Try [Javascript .NET](https://github.com/JavascriptNet/Javascript.Net). It is hosted on GitHub It was originally hosted on CodePlex, [here](http://javascriptdotnet.codeplex.com))


Project discussions: <http://javascriptdotnet.codeplex.com/discussions>


It implements Google V8. You can compile and run JavaScript directly from .NET code with it, and supply CLI objects to be used by the JavaScript code as well. It generates native code from JavaScript. This is usually done by giving each submit button a unique id/name:



```
<input id="sub1" name="sub1" type="submit" value="Submit Form 1" />
```

it's a rubbish name/id, I know, but you get the idea. Then in your form handling routine:



```
if(isset($_POST['sub1'])){
  //code for handling this form
}
``` hmm.  you can use ticket rules to mute the ticket as soon as it gets created.  you can have it look for tickets from that particular email address and mute them as they come in.