Using If Then Statements In Href Tag
Is it possible to use If Then statements in an a href tag? What I am trying to do is I am using a server side include page of navigation inside of a content management system. I have limitations on what I can manipulate and change. So just using style sheets won't do me the trick. I want to have a navigation link change a different color when you are on that section. I have the menu expanding also using if then statements. When a variable is passed somewhere else on the page as true, the menu expands. I figured I could use this in the same way to make the link change colors. I want to do something like:
<A href="#" <% If Variable_name then%> id="link <% end if %>>Link Here </a>
Is that possible? I know that i can do an If then statement and have 2 different links, one with the id and one without, but I wanted to see if I could simplify it at all. I'm not the best with ASP so there might even be better ways then that...I was just using from the little that I knew.
View Replies
ADVERTISEMENT
Have you ever been on ebay-You know when you are checking a persons feedback history, you see a href link to go and see that particular item.
I would like to do the same. If i have a table which i populate with information, if the user clicks on view, i would like to go and show that particular item on another page. Ebay has one unique key (item number), unfortunatley i have a composite key.
How can i do this by adding a href in an asp table and also by having the ability to go directly to the full information about that specific item?
I have done something similar in vb but i used a mshflexgrid but i don't think thats a possibility in asp.
View Replies
View Related
I have a master table of records from a recordset on which thereis a link to a detail page as follows: Code:
<td width="10%" align="left" class="langdetail"><a href="Advanced_Search_detail_template1.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "TeacherID=" & rsViewMusic.Fields.Item("TeacherID").Value %>"><%=(rsViewMusic.Fields.Item("LastName").Value)%></a> </td>
Is it possible to have to include an if then statement to have 2 different detail pages according to an access level (a field in the recordset)?
View Replies
View Related
I saw an url like this
<a
href="{nocache:426d6de96f848e23f89ef8d2a557145f#0}&p=http://www.isbuluyorum.
com>CLICK</a>
What is the purpose of using href="{nocache:1321sdsa . Does anyone have idea about it ?
View Replies
View Related
Can anyone tell me the proper syntax for this statement:
Response.Write "<a href=""Showevent.asp?eventid=<%= objrs.Fields("eventdate").Value %>""">(objRS("eventcaption"))</a>
View Replies
View Related
I would like to have a link that when clicked, sends info to an ASP page to process, but does not submit the entire page. This way, the user will
click on a link and will not be taken to another page, but precessing will occur.
This is mainly for a 'Rating' Application.
Amazon.com does this and I want to know how they do it. Here is the link to the amazon page (you may need to be logged in)
http://www.amazon.com/exec/obidos/t...5480771-6490552.
View Replies
View Related
I'm using W2k Pro, ASP 3, IIS 5 & DWMX 6.1 and code in VBSCRIPT
I currently use the <BASE href=XXXX> in all my pages and just read
that this tag is no longer supported so will soon vanish
I have a couple of sites that I'm working on and to make all my links
work right etc I need to use the base href tag
http://localhost/site1/
http://localhost/site2/
http://localhost/site3/
where online the base href would be
http://www.site1.com/
http://www.site2.com/
http://www.site3.com/
all my links are like <img src=images/mylogo.gif> or <a
src=info/info.asp>Info</a>
Now my problem is how else would I design my sites if I cant use the
Base href tag so the site would work both on LOCAL & REMOTE servers as
needed in the above paths?I'm sure other people develop on a WIN 2k PRO system where you canonly have ONE site (c:inetputwwwrooot) Which was fine when I only
had one site... but when I needed a second I had to change my first to
use the Base href so I could check the sites out locally (offline)
before uploading them to a live server.
View Replies
View Related
when i click the a link i want to see a thing which is like save as target
...
it can be a word doc or xls or whatever. i want to make it dowloadable when
a user click a link.. Code:
View Replies
View Related
If you have a href such as this,
href="somepage.asp?home=alpha&street=beta, how would you include a reference to a bookmark on that page, such as <li id="bookmark">Some List Item</li>
View Replies
View Related
How can i use the variable name instead of a hardcoded value when writing a hyperlink.
strBody = strBody & "<a href="default.htnk">Login</a>"
I would like to use a variable name instead of directly writing default.html like below
strPageName = "default.html"
strBody = strBody & "<a href="<%=strPageName%>">Login</a>"
how this can be done.
View Replies
View Related
Is it possible to create a link to open outlook (Client side) to open a particular folder
here is the code i am trying to use unsuccessfully :
<a href="outlook://Public%20Folders/All%20Public%20Folders/P/W/C/Conf
%20Room/~S%20C%20R">Conference Room 1</a>
Basically what i want to happen is that when a user clicks on the web link that it opens the meeting room which is in a public folder in outlook application (not the web interface outlook.
View Replies
View Related
My href statement as follows isn't working and in fact prohibits the rest of the asp on the page from working. Code:
View Replies
View Related
I am new to web design and ASP, I am developing a site which has a logon script, what I want to do is return a user to the location they were at after login. Some of the pages will have query-string information in the address bar so need capture that as well.
<script language="JavaScript">
x = window.location.href
document.cookie=x
</script>
Appears to do what I want as I can pick up the href out of the cookie after login and return user to page, prob is I don't seem to be able to include it in my server side scripting which is doing the login it falls over at the script tag.....
View Replies
View Related
I have the following href in my asp code. I would like to disable the image
so the user cant click on the javascript for this image.
....
<input type=text name=thedate size=10><a
href=""javascript:show_calendar('dataform.Line" & lineno &
"6',null,null,'YYYY/MM/DD');"" onmouseover=""window.status='Date
Picker';return true;"" onmouseout=""window.status='';return true;""><img
src='../Production/show-calendar.gif' width='24' height='22' border='0'></a>
Is this possible?
View Replies
View Related
I am using Javascript with ASP and am having a problem with a javascript link in that it does not function when clicked. The page is generated correctly without any visible or runtime errors.
A bit of background as to what I'm trying to achieve: i am dynamically creating multiple forms which store details of a products into hidden fields, the information is retrieved from a database recordset. Each product is created in a unique form, this is achieved using a counter variable. I am trying to use javascript to submit the current form - i.e. a hyperlink - which unfortunately doesn't have any effect when clicked. I am thinking I might need to refer to the form differently but am unsure how to.
Below is a sniplet of the source code ....
View Replies
View Related
I want to redirect to other page using document.location.href on Button click and pass ID to that page e.g;
<input type="submit" value="Submit" ONCLICK="document.location.href='mergestatus.asp?projectid= <%=selRs("projectid")%>'">
Please help.I am not able to pass projectid to 'mergestatus.asp'
View Replies
View Related
I have an asp page that is pulling data from a access database. The data will always be a complete email address. I am trying to make the email address on the page a simple hyperlink that opens the default email program upon click. I cannot make it work for the life of me!
<TD align=left><FONT face=Gautami size=2><%=addrRS.Fields("E_Mail")%></font></TD>
View Replies
View Related
I have a session variable who change the selected language (French or English) and i try to change this variable when someone click on my anchor. Code:
View Replies
View Related
I am trying to get a printer.asp page linked back to a main report page. However, in the final url, the grantid is missing which should not be, if the href statement is correct.
I checked the correct value of grantid via response.write and I can see the correct value. However, the href statement cannot pick the value properly. Code:
View Replies
View Related
I am currently setting a cookie that has a variable which is based on the user's bandwidth (High or Low is set by a javascript detection script). However, I'd like to also give the user the option of manually choosing their bandwidth variable (High or Low).
The problem I'm having is being able to change or write the dynamically set cookie to the user's manual preference.
instead of doing this which sets the cookie and redirects the user when the page loads....
View Replies
View Related
I have a .asp page that displays an HTML page: view_msg.asp
There is a link (anchor tag) on that page that when clicked, sends the user to another page. I would like to also execute a MySQL query when that link is clicked. The DB is already open and connected to the page. The current current tag looks like this:
<a href="view_messages.asp"><IMG SRC="example.gif"></a>
and the MySql command I want to send is:
UPDATE Messages SET `fromDisplay`="N" WHERE idMessage=" & idMsg "
In english: When someone clicks on the link I want to execute a MySQL command to set the field value to N... how do I do that?
I know this is a very rookie question - but I don't know enough about asp to know how to execute the command here the way I want. Do I have to turn the image/button into a <FORM> 'submit' button</FORM> and use a redirect? Or, would I use an ONLCKICK. What would the correct syntax be?
View Replies
View Related
I am using Javascript with ASP and am having a problem with a javascript link in that it does not function when clicked.
The page is generated correctly without any visible or runtime errors.
A bit of background as to what I'm trying to achieve: i am dynamically creating multiple forms which store details of a products into hidden fields, the information is retrieved from a database recordset.
Each product is created in a unique form, this is achieved using a counter variable. I am trying to use javascript to submit the current form - i.e. a hyperlink - which unfortunately doesn't have any effect when clicked. I am thinking I might need to refer to the form differently but am unsure how to. Code:
View Replies
View Related
Here's my issue:
I have a very simple form that contains first name, last name, phone, address ...ect. Users enter customer information into this form and submit it. The data goes to an access db. This is a basic HTML form that uses the form action command to call addentry.asp. Addentry.asp then gets the form contents from the Request.Form("") command. This is a total piece of cake and it works fine.
What I want to do is add a link just below the last name field called "Check Name" that will allow them to check and see if the customer they are entering is already in the db based on their first name and last name.
How can I get the contents of the first name and last name textboxes using a link? I invision them clicking the "Check Name" link and it passing the first name and last name through the URL to my checkname.asp page which will then do the rest.
View Replies
View Related
I have a problem with reading data from a form element(s). Instead of using a Type=Submit, I have chosen to use a hyper-link to call a select case structure which adds, edits or deletes a record depending on the contents of the action property.
here is a couple of lines showing two text box's in my form, directly following is the href that passes data to the select statement.
<td><input type="text" name="Desc" id="descid" size="55" /></td> <td><input type="text" name="Units" id="Text1" size="4" /></td> </form>
<td align=right><a href="<%= SCRIPT_NAME %>?action=add&jdate=<%= dDate %>"><img src="Web-add.bmp" alt="Add" width="63" height="25" border="0" /></a></td>
I would like to include the values from the form elements in the action string but have so far drawn blanks. I have attached the full form code.
View Replies
View Related
Could someone help extend this ChangeImage function to also display a different hyperlink underneath the newly selected image?
<script language="javascript">
<!--
/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.username.u_BrokerID.options[document.username.u_BrokerID.selectedIn
dex].value
}
//-->
</script>
<form name="username" method=post action="join_step4.asp" onSubmit="return
CheckForm();">
<SELECT NAME='u_BrokerID' size='1' onChange='showimage()'><OPTION
VALUE='0'>--Select a Broker--</OPTION><option
value="/catamaranco/images/brokers/john_2.jpg">John Anderson</option><option
value="http://www.catamaranco.com/images/brokers/staley_2.jpg">Staley
Weidman </option>
<input type=submit value=submit>
</form>
<br><br>
<a href="Site1.asp">Change this url depending on the value of the image
selected in the dropdown?</a>
View Replies
View Related
I need to pass multple variables in a link in order to go to a asp page with
the two varables.
The following are the values of the variables using response.write:
<%'Response.Write Mypage & "<br>"%>
Exp
<%'Response.Write GrantID & "<br>"%>
4836
The link which I wrote is as follows:
<A HREF="mainreportagain1.asp?grantid=<%=GrantID%> & page=<%mypage%>">Report
Main Page</A>
However, when I am refreshing the page to click this link I am getting the
following error: Microsoft VBScript runtime (0x800A000D)
Type mismatch
View Replies
View Related
I have the following code which displays email address from a database
However, I need to have the email address highlighted so that on clicking
the email box would open up with the email name filled in. Code:
View Replies
View Related
I need to write a reponse.write statement of the following:
<A HREF="default.htm">Click Here to try again</A>
However, I am not clear about the syntax to handle this.
View Replies
View Related
I need some help with some if statements in an asp page I got. My sql statement is:
sql = "select * from courseDesc"
I want to logically diplay all the information on the page. So I inserted this if statement to choose the information I want to dispaly:
<% if rs("courseName") = "whatIsCist" then
response.write(rs("description"))
end if %>
Other courseName titles I need to display the information for further down the page, include: wdt, lan, wan, programming, admissionReq1,2,&3. Does anyone see where my problem is?
View Replies
View Related
I'm having problems getting some ASP code to work with a form I'm using. I'm using the script with a multiple page form and want to print a javascript onsubmit value for just one of the forms. I'm getting errors because of the multiple IF statements and I'm not sure how to do this and have the "s show up properly in the output. Can someone tell me how to do this properly?
Code:
<% If step < 5 Then Response.Write " <form action="/script.asp" method="post" name="theForm" id="theForm" & If step < 1 Then Response.Write " onsubmit=""" & "return checkForm(this);" & End If %> & ">" & End If %>
Here is how I want it to output:
<form action="/script.asp" method="post" name="theForm" id="theForm" onsubmit="return checkForm(this);">
View Replies
View Related
is there a way to use "or, and" statements in asp,
what i want to do it do 2 seperate checks on the database and if one is true or the other one is true then display some text is this possible and also the same check again on the database but the first statement and the second statement has to be true then display some text is this possible, if yes how would i do it?
View Replies
View Related
I have a field on an asp form called hotelYesNo (YesNo value-pulldown) and a field called roomMate.
I want to do an If Then statement likeso: If hotelYesNo = Yes Then roomMate is required, but if hotelYesNo = No Then roomMate is not required.
I don't know how to get this accomplished in the asp code.
I know how to do this in Microsoft Access but not on a webpage.
How would this be done?
View Replies
View Related
I want to run a query and need to use If then statements such as: If this is output, then run this query. Is there a way to do this?
View Replies
View Related