Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 18th, 2004, 04:58 AM
trippleweb trippleweb is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: V
Posts: 702 trippleweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 33 m 26 sec
Reputation Power: 3
Javascript help wanted

Hello , I have very little javascript knowlege could somebody assist me in converting the following code so that only one of the selected changes to a link and the rest remain as variables.

Thank you.


<!--scripts from A1 Javascripts http://www.a1javascripts.com/ -->
<FORM NAME="Menu">


<SELECT name="URL"
onChange="if(options[selectedIndex].value)
window.location.href=
(options[selectedIndex].value)">

<Option Value="page1">Page 1
<Option Value="page2">Page 2
<Option Value="page3.html">Page 3
<Option Value="page4.html">Page 4
<Option Value="page5.html">Page 5
<Option Value="page6.html">Page 6
<Option Value="page7.html">Page 7
<Option Value="page8.html">Page 8
<Option Value="page9.html">Page 9
<Option Value="page10.html">Page 10
<CENTER>

</SELECT>


Reply With Quote
  #2  
Old May 18th, 2004, 06:50 PM
CollegeGuy184 CollegeGuy184 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UCONN, Storrs, CT
Posts: 15 CollegeGuy184 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to CollegeGuy184 Send a message via Yahoo to CollegeGuy184
RE: Javascript help wanted

I dont think I understand your question. If you put the following code into your HTML document, and the pages (page1.html etc.) exist, this code works perfectly:

<html>
<head>
<title>start page</title>
</head>
<body>
<p> select one of the pages below! </p>
<FORM NAME="Menu">
<SELECT name="URL" onChange="if(options[selectedIndex].value)
{window.location.href=(options[selectedIndex].value)}">
<Option Value="">Select One
<Option Value="page1.html">Page 1
<Option Value="page2.html">Page 2
<Option Value="page3.html">Page 3
<Option Value="page4.html">Page 4
<Option Value="page5.html">Page 5
</SELECT>
</FORM>
</body>
</html>

This code causes the user to be redirected to the selected page as soon as it is selected.

Do you want a seperate link to appear below the SELECT object, containing the page that is selected? (exmaple: a 'Go' button, or text link)

Reply With Quote
  #3  
Old May 18th, 2004, 08:18 PM
trippleweb trippleweb is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: V
Posts: 702 trippleweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 33 m 26 sec
Reputation Power: 3
RE: Javascript help wanted

Sorry I wasn't clear, what I am looking for is to have 10 choices, and only one of them will automatically select and go to a link, the rest will just remain as static variables, what I am looking to do is create 2 extra input cells on the form when the certain one is selected.

I have little knowledge of javascript, so when the select one it would "onclick:thiscode.php" and the code would execute an extra field.

Reply With Quote
  #4  
Old May 18th, 2004, 08:26 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to notepad
RE: Javascript help wanted

you mean like this?

Reply With Quote
  #5  
Old May 18th, 2004, 08:41 PM
trippleweb trippleweb is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: V
Posts: 702 trippleweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 33 m 26 sec
Reputation Power: 3
RE: Javascript help wanted

<select name=example>
<option name=choice1>1 //static choice
<option name=choice2>2 //static choice
<option name=choice4>3 //static choice
<option name=choice5 onclick="javascript:executeMyPhpscript.php">5 //dynamic selection
</select>

//php script
include ("originalForm");
echo "<input type=text name=additionalInput><input type=text name=additionalInput2>";

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Javascript help wanted


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek