on clicking any row of the following program... I am firing on function mail file click....function just having alert message that shows different file name on the basis of clicking...
****its working properly in IE .....Firefox N other browser function doesnot call on clicking on any row.. whats problem..please help me......i am writing code for your better awareness****
For Each info In fsi
Response.Write("<span id=" & " 'userijd'" & " onmouseup=" & "mailfileclick('" & info.Name & "')" & ";>")
Response.Write("<td width=" & "16%" & " bgcolor=" & "#FFFFFF" & " style=" & "border-bottom-style: solid; border-bottom-width: 1px" & " bordercolor=" & "#C0C0C0" & " nowrap" & ">")
Response.Write("<font face=" & "Arial" & "style=" & "font-size: 9pt" & " color=" & "#000000" & ">" & Mid(contents, InStr(contents, "Date: ") + Len("Date:"), 17) & "</font></td>")
Response.Write("</span>")
Next
this is vbscript code ... i am just calling function mailfileclick ohkkkkkkk
and ohter part this page i am difing function seebelow...
<script type="text/javascript">
function logintk(str) {
alert(str);
}
</script>
i thing ..now you got clear about coding.... one thine more..this code working fine with Internet Exlorer ...problem Firefox and other browser....i think problem area is...
("")
better u know....u r helping hand ...
Firefox (and all other web browsers) don't run VBScript code. For cross-browser compatibility, you should always use JavaScript, not VBScript.
Related
A friend of mine asked me a favor, help him to install CK Editor into SnitzForum (yeah old I know). Since I am not into asp lang. I have a problem since after putting into the head the CDN code I have to put below the tag this code:
<script> CKEDITOR.replace( 'editor1' ); </script>
So this is the part where the textarea is into the file post.asp:
<%
end if
end if
Response.Write " </font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><textarea cols=""" & intCols & """ name=""editor1"" rows=""" & intRows & """ wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea><br /></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
select case strRqMethod
case "Reply", "ReplyQuote", "TopicQuote"
Response.Write " <script language=""JavaScript"" type=""text/javascript"">document.PostTopic.Message.focus();</script>" & vbNewLine
end select
How can I add that script? Thanks :)
Edited Code:
<!--#INCLUDE FILE="inc_smilies.asp" -->
<%
end if
end if
Response.Write " </font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><textarea cols=""" & intCols & """ name=""Message"" rows=""" & intRows & """ wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea><br /></td>" & vbNewLine & _
" </tr>" & vbNewLine
%>
<script>
tinymce.init({
selector: 'textarea',
toolbar_mode: 'floating',
});
</script>
<%
end if
select case strRqMethod
case "Reply", "ReplyQuote", "TopicQuote"
Response.Write " <script language=""JavaScript"" type=""text/javascript"">document.PostTopic.Message.focus();</script>" & vbNewLine
end select
Ok, so an working example with a text box could (would) be this:
<script src="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.js"></script>
<div style="width:50%">
<asp:TextBox ID="TextBox1" runat="server" Height="304px" Width="617px"
TextMode="MultiLine"
ClientIDMode="Static"
></asp:TextBox>
</div>
<script>
CKEDITOR.replace('TextBox1');
</script>
And we now get this:
So, as noted, it probably better to hide/show the one div above, then trying to inject the above markup into the page. And the REASON why is that then in code behind, you want to be able to get the textbox by using
TextBox1.text
So, by placing a plane jane text box (TextBox1) on the form, then code behind can use that text box. If you inject the markup, then code behind will have a much more difficult time using that markup and using TextBox1.Text to get the results of the markup in that text box.
So I don't see the need to use "code" to inject the above. As I noted, perhaps you need to hide/show this?
Then add a "ID" to the div like this:
<div id="mycooleditor" runat="server" style="width:35%;display:none">
<asp:TextBox ID="TextBox1" runat="server" Height="304px" Width="617px"
TextMode="MultiLine"
ClientIDMode="Static"
></asp:TextBox>
</div>
Now, in code behind, to display the editor, we can go:
mycooleditor.Style.Add("display", "normal")
So, unless you make a REALLY good case as to why we using code to inject the html into the web page as opposed just dropping in the markup as per above without any code (and saving world poverty's at the same time), then I see no reason to spend the time + effort writing code that does the same thing?
You can write code to inject, but I see no reason why when you can just drop in the markup anyway???
Overworked. Put the tinymce files in their own folder (titled "tinyMCE") below the forum root. In the file "inc_header.asp", look for this code (appx lines 240-242):
'## START - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT
Response.Write "<meta name=""copyright"" content=""This Forum code is Copyright (C) 2000-09 Michael Anderson, Pierre Gorissen, Huw Reddick and Richard Kinser, Non-Forum Related code is Copyright (C) " & strCopyright & """>" & vbNewline
'## END - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT
Below that bit, insert this:
If strScriptName = "post.asp" Then
Response.Write " <script src=""./tinyMCE/tinymce.js""></script>" & vbNewLine & _
" <script language=""Javascript"">tinymce.init ({" & vbNewLine & _
" selector:'textarea'," & vbNewLine & _
" theme:'modern'," & vbNewLine & _
" browser_spellcheck:'true'," & vbNewLine & _
" plugins:['advlist anchor autolink charmap code contextmenu directionality emoticons fullscreen hr insertdatetime image link lists media nonbreaking paste print preview pagebreak save searchreplace table template textcolor visualblocks visualchars wordcount']," & vbNewLine & _
" content_css:'css/combined-min.css'," & vbNewLine & _
" toolbar:'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | preview media fullpage | forecolor backcolor emoticons'," & vbNewLine & _
" });</script>" & vbNewLine
End If
That will take over all instances of the text area in "post.asp". If you want to use it throughout the forum for text areas, remove the If/End If lines.
I have an AppleScript that creates a new (HTML-formatted) email in Outlook. I have everything working the way I want but I can't seem to change the color of some of the text within the body of the email. Can this be done via AppleScript?
Thank you in advance,
Jon :-)
Here is a simple example of a body with some red text that can be included in your email creation Applescript:
set theContent to ("Hi:" & "<br>" & "<br>" & "Second <span style=" & "color:red;" & ">word</span> is red." & "<br>" & "<br>" & "Bye," & "<br>" & "<br>" & "Buddy")
I asked a few month back how to hide a few drop down option on a Classic ASP page which were being pulled from a database so that users could not select those options. But now on one of the remaining options there appear 3 radio box options. I have to remove one of those options. The option which I need to remove is called value="_BML7(B)" according to Chrome.
The last time I inserted the following code into the following code into the include.asp file which worked great but that was to hide drop down options. This I need to hide one radio button option from the current drop down options.
Sub buildDropDownList(strCurrentSelection, objListData, strCodeName, strDescriptionName, blnIncludeOther)
If Not objListData.BOF Then
objListData.MoveFirst
End If
Dim currentCodeValue
While Not objListData.EOF
currentCodeValue = objListData(strCodeName)
If (UCase(currentCodeValue)<>"_04GIDBM") And _
(UCase(currentCodeValue)<>"_05GIDFM") And _
(UCase(currentCodeValue)<>"_03MIS(Q") And _
(UCase(currentCodeValue)<>"_06GIDMS") And _
(UCase(currentCodeValue)<>"_08EXHRM") And _
(UCase(currentCodeValue)<>"_10EXMKT") And _
(UCase(currentCodeValue)<>"_12EXTTH") And _
(UCase(currentCodeValue)<>"_15AFT") And _
(UCase(currentCodeValue)<>"_16HSC") And _
(UCase(currentCodeValue)<>"_18LTD") And _
(UCase(currentCodeValue)<>"_19EBM") And _
(UCase(currentCodeValue)<>"_17EXHSC") Then
Response.Write "<option value='" & currentCodeValue & "' "
If StrComp(strCurrentSelection, currentCodeValue, 1) = 0 then
Response.Write "selected"
End If
Response.Write ">" & objListData(strDescriptionName) & "</option>" & VbCrLf
End If
I could really use the help on this and thank everyone in advance for their help! I not very good with Classic ASP but I'm trying.
Here is the code that I inserted last time on the include.asp file.
<p align="center">
<%
do until rsProgramLevel.EOF
Response.Write "<input type=""radio"" name=""programcode"" onclick=""onProgramCode()"" "
Response.Write "value=""" & rsProgramLevel("ProgramCode") & """ "
if rsProgramLevel("ProgramCode") = strProgramCode then
Response.Write "checked"
end if
Response.Write ">"
Response.Write " "
Response.Write rsProgramLevel("LevelDescription") & " (£" & FormatNumber(rsProgramLevel("ChargeValue"), 2) & ") "
Response.Write " "
rsProgramLevel.MoveNext
loop
%>
</p>
You could compile the list into a string, like so...
Const ignoreCodes = " _04GIDBM _05GIDFM _03MIS(Q _06GIDMS _08EXHRM _10EXMKT _12EXTTH _15AFT _16HSC _18LTD _19EBM _17EXHSC "
Add it to the very top of your file (after any Option Explicit commands). If you have new codes to add to it simply ensure that there's a space either side of it.
Then just test against it...
If Instr(ignoreCodes, UCase(currentCodeValue)) = 0 Then
Response.Write("<option value='" & currentCodeValue & "' ")
If StrComp(strCurrentSelection, " " & currentCodeValue & " ", 1) = 0 then
Response.Write " selected "
End If
Response.Write(">" & objListData(strDescriptionName) & "</option>")
End If
If you think about this further, then simply include the list in a redundant codes table in a database.
To make this simple, just wrap the code sending the HTML with a basic If..Then statement:
Dim currentCode
do until rsProgramLevel.EOF
currentCode = rsProgramLevel("ProgramCode")
If UCase(currentCode)<>"_BML7(B)" Then
Response.Write "<input type=""radio"" name=""programcode"" onclick=""onProgramCode()"" "
Response.Write "value=""" & currentCode & """ "
if rsProgramLevel("ProgramCode") = strProgramCode then
Response.Write "checked"
end if
Response.Write ">"
Response.Write " "
Response.Write rsProgramLevel("LevelDescription") & " (£" & FormatNumber(rsProgramLevel("ChargeValue"), 2) & ") "
Response.Write " "
End If
rsProgramLevel.MoveNext
loop
I'm having trouble making a Msgbox modal. Every time I add ', +vbSystemModal' to the end, it just breaks my script saying -Invalid procedure call or argument: 'Msgbox'-
I'm using something similar to the following code (but, longer, with more calls and stuff)
MsgBox "Hello " & objUser.givenName & ", Please note that your password Expires in " & daysLeft & " day(s)" & " at " & whenPasswordExpires & chr(13) & chr(13) & "You have less than one day left! It is advised that you update your password immediately to avoid network issues." & chr(13) & chr(13) & "Please press CTRL-ALT-DEL and select the 'Change a password' option before your password expires!", "PASSWORD EXPIRATION WARNING!", +vbSystemModal
Is it calling the daysleft and username that breaks it? How can I work around this to make it a modal message?
thanks in advance.
EDIT: As explained above, using ", +vbSystemModal" simply breaks the script.
Using the following worked:
MsgBox "Message goes here!", 4096, "Title of message!"
The 4096 sets it as a Msgbox with an 'OK' option and modal settings.
This works better than ", +vbSystemModal" when your message is broken up as you call information.
I am maintaining a site that uses a HTML editor with an image upload feature. When you click upload it opens a popup that lists a path to every image in the folder. There are currently more than 7000 images in the folder.
The code is quite messy. It uses the Scripting.FileSystemObject to get an array of the files and then loops using a for each statement.A response.write is used to display each file's info and for some reason an issue is occurring if there's more than 4015 images in the folder. No error is occurring as such but it seems the function writing out the files just fails silently and the page stops rendering.
I am confused why it works when there's less than 4015 files. Could it be a memory issue ? I was expecting to receive an error of some sort.
Thanks for any info.
Below is the Response.Write being used for each file
Response.Write "<tr style='background:" & sColorResult & "'>" & VbCrLf & _
"<td><img src='images/"&sIcon&"'></td>" & VbCrLf & _
"<td valign=top width=100% ><u id=""idFile"&nIndex&""" style='cursor:pointer;' onclick=""selectFile(" & nIndex & ")"">" & oFile.name & "</u> <img style='cursor:pointer;' onclick=""downloadFile(" & nIndex & ")"" src='download.gif'></td>" & VbCrLf & _
"<td valign=top align=right nowrap>" & FormatNumber(oFile.size/1000,1) & " kb </td>" & VbCrLf & _
"<td valign=top nowrap onclick=""deleteFile(" & nIndex & ")""><u style='font-size:10px;cursor:pointer;color:crimson' " & sFolderAdmin & ">" & VbCrLf
if not bWriteFolderAdmin then
Response.Write "<script>document.write(getTxt('del'))</script>" & VbCrLf
end if
Response.Write "</u></td></tr>" & VbCrLf
Sounds like the issue here was the response buffer filling up. Either of these solutions should work:
Disable buffering by adding Response.Buffer = False as the first line of code.
Leave buffering enabled but call Response.Flush() at certain intervals to flush the buffer.