Jump to content

[SOLVED] I'm new to JavaScript so be nice. Not working Link.


paulman888888

Recommended Posts

I am a happy at PHP but i wanted to start learning JavaScript so after reading off w3 i started to make a link using a form.

 

here is what is out puted after PHP.

I decide not to show you the PHP incase you dont do it.

Heres the javascript line

<a href="#" onclick="window.location.href='?page=Packages&id'+Form.request.package;"> View Package Details </a>

What i tryed doing is making JavaScript Take the user to a new page but useing a bit of information selected by the user from a drop down menu form.

 

<form id="request" method="POST" action="index.php?page=Request"><br />
<input id="name" style='width:70%;' name="name"  type="text" maxlength="50" value="Name" /><br />
<input id="email" style='width:70%;' name="email"  type="text" maxlength="250" value="Email Address" /><br /><select name="package"><option value="  ">Guru</option><option value="  ">Starter</option><option value="  ">Advance</option><option value="  ">Master</option><option value="  ">Basic</option></select><a href="#" onclick="window.location.href='?page=Packages&id'+Form.request.package;"> View Package Details </a><br /><textarea id="msg" style='width:90%; height:200px' name="msg">Please Enter Your Plan Here Including what feature you want, like; Guessbooks, Forums, Upload area, Members area and ect.</textarea><br />

<input id="Submit" type="submit" name="Submit" value="Submit" /></form>

 

Please help me my this link work.

 

Thankyou for any help

Paul

Thankyou for the help but it still is not working.

 

Heres the firefox error console;

Error: Document.Form is undefined
Source File: http://testing.hidden address.com/index.php?page=Request#
Line: 1

 

Heres the update javascript code with PHP removed.

<a onclick="window.location.href='index.php?page=Packages&id='+Document.Form.request.package.value;" href="#"> View Package Details </a>

Thankyou all again.

 

With your help i fixed it.

<a onclick="window.location.href='index.php?page=Packages&id='+request.package.selectedIndex;" href="#"> View Package Details </a>

 

The reason it didn't work was because i used .value a the end but its not a text field so it didn't work. i had to use .selectedIndex and remove the stuff before. it

 

Thankyou again

Paul

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.