Refreshing A Href Variable Using OnChange Of A Select List

Jul 20, 2005

I'm trying to use the following script:

<script language="javaScript">
function setrepto(){
document.aForm.repno.value =
document.aForm.rep.options[document.aForm.rep.selectedIndex].value;
}
</script>

On the following form (Partly in asp):

<form name="aForm">
<select name="rep"
<option value="ALL">Select a Rep Here</option>
<%
while not slsrs.eof
repno = slsrs("SLS#")
repname = slsrs("SLSNAM")%>
<option value="<%=repno%>"><%=repname%></option>
<%slsrs.movenext
wend%>
</select>
</form>

To change the value of 'repno' in the following href, which is on the
same page:

<a href="nextpage.asp?rep=<%=repno%>">Click here</a>

So basically, as a user changes the selection, the value of repno in
the above href should change.

View 3 Replies


ADVERTISEMENT

Refrest A Select List W/o Refreshing The Page?

Oct 5, 2010

is it possible to refresh a select list on it's own without refreshing the whole page?

View 3 Replies View Related

JQuery :: Access The 'a Href' In A List Item In An Unordered List??

Oct 8, 2010

i have a menu and i would like to change the color of the Categories which have subcategories only. In my example the basic categories are: News , Announcements , Contact and Career. Only Announcements and Career categories have subcategories. So i would like those two to turn green. The fact is that the list items include a href ,so i don't know how to access those "a href" combined with "this".

<ul id="my_menu">
<li id="id0"><a href="#" style="text-decoration:none">News</a></li>
<li id="id1"><a href="#" style="text-decoration:none">Announcements</a>
<ul>

[Code].....

View 3 Replies View Related

Reload Dropdown List Without Refreshing Page?

Dec 1, 2011

How can I execute this:From the dropdown list build up from mysql database (say a list of fruits).I select "Add New Fruit". This triggers it to either have a modal form to add new fruit or a table form.Once submitted, Select dropdown list RELOADS including the newly added data (fruit) without reloading the whole page which contains other form control such as textbox.

View 1 Replies View Related

SELECT OnChange Auto Fill Other SELECT Boxes

Jul 25, 2002

I searched here and some other places on the net but cant find anything that suits my needs. I have a SELECT box with 3 values Code:

<form name="form1">
<select name="length">
<option name="length" value="none">--Select for All--</option>
<option name="length" value="5">--5 Days--</option>
<option name="length" value="7">--7 Days--</option>
<option name="length" value="10">--10 Days--</option>
</select>
</form>

OnChange, I want to invoke a function that auto populates the rest of the SELECT fields in the form. The select boxes will vary in quantity as the page is dynamic, but the values are always the same (like the code above).

Does this make sense?

View 9 Replies View Related

JQuery :: Not Refreshing Page - Form That A User Selects Item From Dynamic List

Mar 26, 2011

I have a search form that a user selects item from dynamic list hits the submit button and it returns each matchingresulton same page in an update form, i have 2 checkboxes in update form that updates the DB when 1 is checked, this all works fine until i check the checkbox the data updates ok but allremainingupdate forms are removed because the page refreshes.

So i need to update formstwith out page refreshing but i cant get it to work with multiple forms on same page.

View 2 Replies View Related

List-style Img As A Href?

May 17, 2002

I am wondering if there is a way to set the list-style img attribute in css to actually be a href to the external .js ??? Or can I set the img attr to a href through the dom using "append"?
If not, does anyone have some good ideas on how I can acheive this so that the list stays expanded until only the FIRST item is clicked on.

View 7 Replies View Related

Stop Select From Refreshing To First Item On Page Refresh

Apr 7, 2010

I have a selection tag that has a list of dates for data collection, user selects a date and the pages refreshes to display data on a map problem is that the user's selected item in the selection is not preserved during the refresh and the selection drop-down refreshes to the first item of the list. How can I preserve the selected item in the drop-down after page refresh?

View 3 Replies View Related

Variable To Be Used In Href?

Jul 14, 2010

Please check out the code and tell me how can i use the variable as a href link.

var rand_link = new Array ();
rand_link[0]="asdhrfe22k";
rand_link[1]="iqh3wjhs8s";

[code].....

View 2 Replies View Related

JQuery :: Limit If A Value Can Be Selected In A Drop Down List (select) Based On Other List

Jun 9, 2009

I have a page that displays a list of people playing in a tournament. I need to be able to generate a Leaderboard based on which players are manually selected by the admin. Next to each person there is a drop-down list. An admin can go in and select a "slot" that a player should be in on the leader board from 1 to 8, or leave it blank if none. What I need to figure out how to do is the following, when a change event happens on a drop-down list, and say the value 5 is selected, I need to check to make sure that 5 is not already selected in one of the other players drop-down lists, in other words, that the 5th leaderboard slot is not already full. if it is, display an error message and make them change that one first. how to do that with jQuery? I'm thinking it will have something to do with the each() function, but not sure exactly how the logic should work.

View 4 Replies View Related

Href With Variable In Link

May 21, 2006

I am trying to make a variable link on a page. The page has a text box
for a stock symbol. The code is: <input type=TEXTBOX Name="symtb"
value="" size="10>

The value of the text box {the stock symbol} will complete the url.

I found code for a variable link:
<script language="JavaScript">
<!--
function variable_in_link(varible_value)
{
new_win = window.open('http://finance.yahoo.com/q?s=" +
varible_value'')
}
// -->
</script>

The link I am trying to use is: <a
href="javascript:variable_in_link(symtb)">The text</a>

No matter what I do the variable_value comes back as undefined. There
is always a value in the text box.

View 6 Replies View Related

Passing Variable To A Href?

Jan 20, 2011

im trying for last 4 days. please help me out

Code:
<input name="name" type="text" value="Raj" />
<a href="01.php?name=(document.getElementById('name').value" class="nyroModal" rev="modal">click here</a>

View 2 Replies View Related

Onchange To Fill Second Dropdown List Doesn't Work?

Apr 16, 2009

I have 2 dropdown lists which are connected to a mysql database. When I select an item from the first dropdown list the second dropdown list should show item which are linked to the item from the first list. But the thing is I can select an item from the first one, but the second isn't showing anything.

In the mysql database I have 2 tables: hesk_programma and hesk_projecten. In table hesk_programma there are a ProgrammaID and Programma column. In table hesk_projecten there are a ProgrammaID, a ProjectNumber and a Project column.

ProgrammaID from the two tables are connected to each other, so when I select an item from the first dropdown list with the ProgrammaID AK, the second dropdownlist should only display the items with the ProgammaID AK from the hesk_projecten.

Here is the code I use:

PHP Code:

<?php 
mysql_connect("localhost", "root", "");
mysql_select_db("bestellingen");
$query = "SELECT * FROM hesk_programma ";

[Code]....

By the way, one more thing. The ProjectNumber from the hesk_projecten table should be displayed (when selecting an item in the second dropdownlist) in a input text field.

View 1 Replies View Related

Onchange Event Doesn't Trigger When For A Drop-down List?

Jan 21, 2009

I have made a drop-down list on my html form using <select> tag. I am using a onchange event for this select tag. My problem is that the onchange event triggers only when I use the mouse to change the value to drop-down list. When I use tab key to focus on the list and then change the value using up-down keys, the onchange event does not get triggered.

View 5 Replies View Related

Passing A JavaScript Variable In Href

Oct 26, 2005

For ease of future modifications on my page, I want to have a list of URLs stored in an Array, and I want to then use these URLs in an href tag. Something like this:

<SCRIPT>
menuURL[0]="page2.htm";
menuURL[1]="javascript://";
...
</SCRIPT>
<BODY>
<A HREF = menuURL[0] ........

How is something like this possible, as well as being fairly crossplatform, and intuitive? I've changed the syntax, and tried various other things to no avail.

View 3 Replies View Related

Get String Variable In Href Attribute Of A Tag?

Jan 4, 2011

When I click the name, I should go the particular page about that person.

<script type="text/javascript">
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.onreadystatechange=verify;
xmlDoc.load("a.xml");
[Code]....

View 1 Replies View Related

Reload A Html Page OnChange Event Of Dropdown List?

Nov 25, 2009

I want to reload an html page onChange event of dropdown list and retain the old values filled in the page.

View 1 Replies View Related

OnChange Select Box?

Jan 19, 2006

How can I change a select list when a user enters a value into a text box? Like with the below form I would like to have the select box change when the user enters a value in the "id" text box that matches a value in the select box. Say the user types "1122" in the text box I would like the select list to change to to show "John". Is this possible ....

View 5 Replies View Related

Calling Variable In Onchange Function

Jul 23, 2005

I am using a javafunction (onclick in select) in which i am calling a
function in php (thats why i send this to both php and javascript
newsgroups).

in the onclick i call the function "Place_Selected" with the value from the
select (naam_keuze.value)

in the function the value becomes the $zoek_id and searches in the database
for the record with the id of $zoek_id

the naam_keuze.value does not give the value to $zoek_id When i replace naam_keuze.value for a number (15) i works great.

WHAT AM I DOING WRONG? Code:

View 5 Replies View Related

Using Onchange To Call PHP Include And Set Php Variable?

May 14, 2010

I'm building a form in PHP. One of the fields needs to generate information based on another selected input. The first input is for "phase" and based on that I need to count how many entries there are in the database for that phase, then display posible positions(ie 1 per entry including the entry being edited/added). I know that this can't be done with only PHP.

I don't work with Javascript normally so I am struggling. I have read many similar topics, but can't find the answer I am looking for.

I thought that the solution could be to call an include file when a selection for phase is made, but I don't know how to pass the information to the PHP script.

I'd prefer not to have to reload the page or form.

Here's the code that I have so far:

Code:

<html>
<head>
<body>
<form action="edit-category.php?id=<?php echo $id; ?>" method="post"

[Code]....

View 5 Replies View Related

JQuery :: Child - Get The Href Attribute In A Variable?

Aug 3, 2010

How can I get the href attribute in a variable?

View 1 Replies View Related

JQuery :: Send Href Variable To New Page Img Src?

Apr 14, 2011

I have a base html page which contains several thumbnail images with links to enlarged images which I'd like to view in an external page [so I can control the dimensions of the enlarged image]. I thought it best to use an externaltemplate html page to launch these within and therefore imagine I need to declare the variable in the thumb links page & image they may need to look something like this:

<a href="mytemplate.html?imgVar=/images/collection/large1.jpg">thumb1.jpg</a>
<a href="mytemplate.html?imgVar=/images/collection/large2.jpg">thumb2.jpg</a>
<a href="mytemplate.html?imgVar=/images/collection/large3.jpg">thumb3.jpg</a>

Then in the external page pick up the variable something like:

<img src="imgVar">

I've looked all over Google & can only see something similar to this in php. Is there a way to achieve this with jQuery instead?

View 2 Replies View Related

Speedscript Variable In Html Href Tag Not Working

Aug 23, 2010

I have an existing website I an trying to modify. In speedscript I have my include libraries and a veriable. Then I need to do an href with a link I have the code as follows <a href="WI_testweb/" + "custno" + ".xls">Matrix</a> The custno is the variable. Is there a way of doing this since the way I an trying is not working?

View 4 Replies View Related

JQuery :: Select A Sub-list From A Long List?

Aug 14, 2009

I have a MySQL table with 90 columns and I want the users to be able to select any columns they concern and output the result accordingly. In the front-end, I can use a group of checkbox which looks very ugly and I can not setup the orders for selected columns. Is there a plug-in or some examples in jQuery, that I can make 2 parallel boxes (i.e. an original-box and a selected-box). the original- box lists all of the column names at the beginning and there is a way to move items between two boxes. And the order of items in the selected-box can be adjusted. the items in the selected-box will be used to build into an array in my backend code.

View 1 Replies View Related

<select..onchange() > With Only One <option>

Sep 27, 2007

I have a bunch of select statements in a form, and each select statement
has an onchange="do_something(this)" in it, and this works
nicely..except when there is only ONE OPTION in a given select.
It seems you cannot 'onchange' a single option!

Well, that is reasonable.

The trouble is I have no way of selecting it since the form itself is a
dummy: The form action is basically to submit to a new script with
hidden variables carefully set to get the desired action depending on
the last option selected Code:

View 14 Replies View Related

Get Value Of (form) Select OnChange?

Feb 4, 2009

How can I get and pass the value of an HTML form select object to a javascript function? code...

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved