473,698 Members | 2,883 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Script Help

Sev
Website: www.flywessex.blogspot.com

You can see from the page source what an effin' mess I'm making of the
site. Aside from all the obvious alignment issues, I can't get the code
to link to the web pages within the pop up boxes. They did a minute
ago, and now I've been editing the template, they don't.

Sorry if I have not supplied enough information - but I know nothing.
Anything I've done has been from searching google and copying code.

Please help.
Jul 23 '05 #1
2 1319
Sev wrote:
Website: www.flywessex.blogspot.com

You can see from the page source what an effin' mess I'm making of the
site. Aside from all the obvious alignment issues, I can't get the code
to link to the web pages within the pop up boxes. They did a minute
ago, and now I've been editing the template, they don't.

Sorry if I have not supplied enough information - but I know nothing.
Anything I've done has been from searching google and copying code.

Please help.


Hi Sev,

:) Fortunately your problem is very easy to fix.

Below is a snippet of javascript and html from your site:

<form name = "INTERVIEWS ">
<select name="site" size=1>
<option value="">Click to select</option>
<option value="http://some page.html">text
</select><br><br>
<input type=button value="Go!" onClick="javasc ript:formHandle r(this)">
</form>

<SCRIPT LANGUAGE="JavaS cript">
<!-- Begin
function formHandler(for m){
var URL =
document.form.s ite.options[document.form.s ite.selectedInd ex].value;
window.location .href = URL;
}
// End -->
</SCRIPT>

Sev, here is a more "correct" way of doing it. For your forms write
them out like so:

<form name = "abc" onSubmit = "return formHandler(thi s)">
<select name = "site" size = "1">
<option value = "http://value1">text 1</option>
<option value = "http://value2">text 2</option>
</select>
<input type = "submit" value = "Go!">
</form>

For your javascript portion, it would be better if you moved it into
the <head></head> section of your html, and rewritten like so:

<script language = "javascript " type = "text/javascript">
<!--
function formHandler(myF orm)
{
var URL = myForm.site.opt ions[myForm.site.sel ectedIndex].value;
window.location .href = URL;

return false;
}
//-->
</script>

The problem with your current script is you have your input button call
formHandler with "this". But "this" is really a reference to the input
button, and not the form that you were hoping for. Hope this helps. :)

Jul 23 '05 #2
Sev
web.dev wrote:
Sev wrote:
Website: www.flywessex.blogspot.com

You can see from the page source what an effin' mess I'm making of the
site. Aside from all the obvious alignment issues, I can't get the code
to link to the web pages within the pop up boxes. They did a minute
ago, and now I've been editing the template, they don't.

Sorry if I have not supplied enough information - but I know nothing.
Anything I've done has been from searching google and copying code.

Please help.

Hi Sev,

:) Fortunately your problem is very easy to fix.

Below is a snippet of javascript and html from your site:

<form name = "INTERVIEWS ">
<select name="site" size=1>
<option value="">Click to select</option>
<option value="http://some page.html">text
</select><br><br>
<input type=button value="Go!" onClick="javasc ript:formHandle r(this)">
</form>

<SCRIPT LANGUAGE="JavaS cript">
<!-- Begin
function formHandler(for m){
var URL =
document.form.s ite.options[document.form.s ite.selectedInd ex].value;
window.location .href = URL;
}
// End -->
</SCRIPT>

Sev, here is a more "correct" way of doing it. For your forms write
them out like so:

<form name = "abc" onSubmit = "return formHandler(thi s)">
<select name = "site" size = "1">
<option value = "http://value1">text 1</option>
<option value = "http://value2">text 2</option>
</select>
<input type = "submit" value = "Go!">
</form>

For your javascript portion, it would be better if you moved it into
the <head></head> section of your html, and rewritten like so:

<script language = "javascript " type = "text/javascript">
<!--
function formHandler(myF orm)
{
var URL = myForm.site.opt ions[myForm.site.sel ectedIndex].value;
window.location .href = URL;

return false;
}
//-->
</script>

The problem with your current script is you have your input button call
formHandler with "this". But "this" is really a reference to the input
button, and not the form that you were hoping for. Hope this helps. :)


I've no idea what it all means but it works! Thanks a million, Web.dev.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4004
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
7
4882
by: Randell D. | last post by:
Folks, I am working on a contact db using PHP and MySQL. My results so far outputs a slimed down version of records to the browser. I would like to implement a method whereby the user can click on a text link which will then show the full record. I don't want to have hyperlinks with values incorporated in the link (thus, I don't want to have http://www.example.com?abc=1234) - I prefer to use a POST method thus what I would like to do...
1
6019
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that required fields in a form have values. I'm writing the values to the client using document.write only so that I can confirm that the values are there to be played with - this is not the final result so please (unless it's leading to the script failure)...
2
2029
by: Mark Hannon | last post by:
I am trying to wrap my brain around storing form elements inside variables & arrays before I move on to a more complicated project. I created this simple example to experiment and as far as I can tell, it should work but it doesn't. Can someone tell me where I went wrong? <html><head> <title>Form Test</title> <script language="JavaScript> <!-- function copy(){
7
2133
by: Steve Wylie | last post by:
Last year a kind soul by the name of Lasse Reichstein Nielsen answered a question for me on this newsgroup, including a script that solved my problem. I now need to script to be slightly amended to take account of something, and I am posting this message in the hope that Lasse, or another equally talented reader, can help with this latest tweak to the script. On this newsgroup I asked for help with a questionnaire I was doing in HTML &...
10
6908
by: Kathy Burke | last post by:
HI. in asp.net app, I have an xmlDocument that I transform to the client html. Using xsl I create a few textboxes to capture user input. Each of these are related to <data> elements in the xmlDoc. I want to use the Forms collection to post the html form back to an asp.net page, and process each request.form object (textbox) via an xml node.value update. For any given xmlDocument there is an unknown number of items resulting in...
5
17704
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input type=password maxlength="8" name="password" value="`pss`"> where usr and pss are sent from the previous form.
4
2257
by: Cerebral Believer | last post by:
Hi I need help! Forgive me I am a PHP newbie. I have a small script that enables me to send a form from an HTML page. I want to use the HTML formatted form because the design of my website is complex, and I don't want to have to mess around with formatting a page using HTML within php. So basically the "action" of the HTML page sends the form to "ProcReg.php". This is the code: <?php /* Script name: ProcReg.php
5
2543
by: plumba | last post by:
Hi all I have a form (see below), which for some reason has decided to stop functioning all together. It just does not call up the function. It is called up in the opening <form> tag but fails.... Any ideas??? <html> <head><title>New Details</title> </head> <center> <H2><IMG SRC="$(path)smlogo.gif"><br>
0
3385
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options within options. I have everything being dynamically named from the previously dynamically named element. (I hope this makes sense.) I am not able to retrieve any of the dynamically created values. I can view them on the source page but can't pull them...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.