473,586 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with a form!

Good mornin' colleagues!

I have a problem with a javascript code. I attempt to program a mini
application with javascript. This application is part of a frameset.

I select three fields in this page and need that with this information
the javascript code compose an "URL" to put the desired page into the
frame named "mainframe" .

My common errors are that this program don't put the desired page.

I need correct my code but I don't know very much of this language...
Can you help me?

##### The code as follows

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Estudi o de Puntos de Venta y Centros de Consumo</title>
<meta CONTENT="text/html; charset=utf-8" HTTP-EQUIV="Content-Type"/>
<meta content="Resume n del &quot;Estudi o de Puntos de Venta y Centros
de Consumo&quot;" name="descripti on"/>
<meta content="" name="keywords"/>
<meta content="" name="author"/>
<meta content="lv**** **@velmark.com. mx" name="email"/>
<meta content="Velmar k, S. A. de C. V., 2005" name="copyright "/>
<link type="text/css" rel="stylesheet " href="style.css "/>
<style type="text/css">
<!--
body {
background-color: #006699;
}
-->
</style>
<script language="javas cript">
function proceso() {

a = document.formul ario;

var documento = '';
var carpeta = 'content';
var camino = '';

if (a.plaza.value= 0 && a.tipo.value=0)
documento = "monterrey_clus ter.htm";
else
if (a.plaza.value= 0 && a.tipo.value=1)
documento = "monterrey_cond .htm";
else
if (a.plaza.value= 1 && a.tipo.value=0)
documento = "v_mexico_clust er.htm";
else
if (a.plaza.value= 1 && a.tipo.value=1)
documento = "v_mexico_cond. htm";
else
if (a.plaza.value= 2 && a.tipo.value=0)
documento = "leon_cluster.h tm";
else
if (a.plaza.value= 2 && a.tipo.value=1)
documento = "leon_cond.htm" ;
else
if (a.plaza.value= 3 && a.tipo.value=0)
documento = "merida_cluster .htm";
else
if (a.plaza.value = 3 && a.tipo.value = 1)
documento = "merida_cond.ht m";
else
if (a.plaza.value = 4 && a.tipo.value = 0)
documento = "culiacan_clust er.htm";
else
if (a.plaza.value = 4 && a.tipo.value = 1)
documento = "culiacan_cond. htm";
else
if (a.plaza.value = 5 && a.tipo.value = 0)
documento = "tijuana_cluste r.htm";
else
if (a.plaza.value = 5 && a.tipo.value = 1)
documento = "tijuana_cond.h tm";
else
if (a.plaza.value = 6 && a.tipo.value = 0)
documento = "puebla_cluster .htm";
else
if (a.plaza.value = 6 && a.tipo.value = 1) {
documento = "puebla_cond.ht m";
else
if (a.plaza.value = 7 && a.tipo.value = 0) {
documento = "nvo_laredo_clu ster.htm";
else
if (a.plaza.value = 7 && a.tipo.value = 1) {
documento = "nvo_laredo_con d.htm";
camino = (carpeta + '/' + documento + '#' + pregunta);

};
</script>
<noscript>
<p>Su navegador no soporta JavaScript&reg; </p>
</noscript>
</head>
<body>
<h1 class="toctitle ">Plaza</h1>
<form name="formulari o" action="" method="post" enctype="text/plain"
target="mainfra me">
<table width="200" border="0">
<tr>
<td>Plaza</td>
<td><select name="plaza" id="plaza">
<option value=0>Monterr ey</option>
<option value=1>Valle de México</option>
<option value=2>León</option>
<option value=3>Mérida </option>
<option value=4>Culiacà ¡n</option>
<option value=5>Tijuana </option>
<option value=6>Puebla</option>
<option value=7>Nuevo Laredo</option>
</select></td>
</tr>
<tr>
<td>
</td>
<td>
<input type="radio" name="tipo" id="tipo" value=0
checked>Clúste r<br>
<input type="radio" name="tipo" id="tipo" value=1>Condici ones
</td>
</tr>
<tr>
<td>Pregunta</td>
<td><select name="pregunta" id="pregunta">
<option value=0>Plaza</option>
<!-- ¿Filtros? -->
<option value=1>F1</option>
<option value=2>F2</option>
<!-- Preguntas -->
<option value=3>1</option>
<option value=4>2</option>
<option value=5>3</option>
<option value=6>4</option>
<option value=7>5</option>
<option value=8>6</option>
<option value=9>7</option>
<option value=10>8</option>
<option value=11>9</option>
<option value=12>10</option>
<option value=13>11</option>
<option value=14>12</option>
<option value=15>13</option>
<option value=16>14</option>
<option value=17>15</option>
<option value=18>16</option>
<option value=19>17</option>
<option value=20>18</option>
<option value=21>19</option>
<option value=22>20</option>
<option value=23>21</option>
<option value=24>22</option>
<option value=25>23</option>
<option value=26>24</option>
<option value=27>25</option>
<option value=28>26</option>
<option value=29>27</option>
<option value=30>28</option>
<option value=31>29</option>
<option value=32>30</option>
<option value=33>31</option>
<option value=34>32</option>
<option value=35>33</option>
<option value=36>34</option>
<option value=37>35</option>
<option value=38>36</option>
<option value=39>37</option>
<option value=40>38</option>
<option value=41>39</option>
<option value=42>40</option>
<option value=43>41</option>
<option value=44>42</option>
<option value=45>43</option>
<option value=46>44</option>
<option value=47>45</option>
<option value=48>46</option>
<option value=49>47</option>
<option value=50>48</option>
<option value=51>49</option>
<option value=52>50</option>
<option value=53>51</option>
<option value=54>52</option>
<option value=55>53</option>
<option value=56>54</option>
<option value=57>55</option>
<option value=58>56</option>
<option value=59>57</option>
<option value=60>58</option>
<option value=61>59</option>
<option value=62>60</option>
<option value=63>61</option>
<option value=64>62</option>
<option value=65>63</option>
<option value=66>64</option>
<option value=67>65</option>
<option value=68>66</option>
<option value=69>67</option>
<option value=70>68</option>
<option value=71>69</option>
<option value=72>70</option>
<option value=73>71</option>
<option value=74>72</option>
<option value=75>73</option>
<option value=76>74</option>
<option value=77>75</option>
<option value=78>76</option>
<option value=79>77</option>
<option value=80>78</option>
<option value=81>79</option>
<option value=82>80</option>
<option value=83>81</option>
<option value=84>82</option>
<option value=85>83</option>
<option value=86>84</option>
<option value=87>85</option>
<option value=88>86</option>
<option value=89>87</option>
<option value=90>88</option>
<option value=91>89</option>
</select></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Procesar "
onClick="proces o();"></td>
</tr>
</table>
</form>
<p>&nbsp;</p>
<p> <br>
<br>
</p>
</body>
</html>

##### End of code

Aug 1 '05 #1
4 1413
JRS: In article <11************ **********@g47g 2000cwa.googleg roups.com>
, dated Mon, 1 Aug 2005 06:23:15, seen in news:comp.lang. javascript,
LinuxNT <fa***********@ gmail.com> posted :
I have a problem with a javascript code. I attempt to program a mini
application with javascript. This application is part of a frameset.

I select three fields in this page and need that with this information
the javascript code compose an "URL" to put the desired page into the
frame named "mainframe" .

My common errors are that this program don't put the desired page.
One error : the conditional equality test operator is ==, not = .

I need correct my code but I don't know very much of this language...
Can you help me? <script language="javas cript">

<script type="text/javascript"> // is better
Your vast conditional replacement might be replaced by

var DOC = [
["monterrey_clus ter.htm", "monterrey_cond .htm"],
// ...
["nvo_laredo_clu ster.htm", "nvo_laredo_con d.htm"]
]

documento = DOC[+a.plaza.value][+a.tipo.value]
as it seems that the indexes are always valid.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Aug 1 '05 #2
Guy
bonjour,

LinuxNT a écrit:
Good mornin' colleagues!

I have a problem with a javascript code. I attempt to program a mini
application with javascript. This application is part of a frameset.

I select three fields in this page and need that with this information
the javascript code compose an "URL" to put the desired page into the
frame named "mainframe" .

My common errors are that this program don't put the desired page.

camino = (carpeta + '/' + documento + '#' + pregunta);

try location.href below

parent.mainfram e.location.href =carpeta + '/' + documento + '#' + pregunta;
GR
};
</script>
<noscript>


Aug 2 '05 #3
Good morning!

I had attempt all the changes suggested, but my script don't launch the
page requested.

As talks 1 a day ago: this code is a part of a frameset and I need that
the selected page to be displayed at frame "mainframe" .

Thanks in advance again.

The code as follows:

# ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Estudi o de Puntos de Venta y Centros de Consumo</title>
<meta CONTENT="text/html; charset=utf-8" HTTP-EQUIV="Content-Type"/>
<meta content="Resume n del &quot;Estudi o de Puntos de Venta y Centros
de Consumo&quot;" name="descripti on"/>
<meta content="" name="keywords"/>
<meta content="" name="author"/>
<meta content="lv**** **@velmark.com. mx" name="email"/>
<meta content="Velmar k, S. A. de C. V., 2005" name="copyright "/>
<link type="text/css" rel="stylesheet " href="style.css "/>
<style type="text/css">
<!--
body {
background-color: #006699;
}
-->
</style>
<script type="text/javascript">
function proceso() {

a = document.formul ario;
pregunta = a.pregunta.valu e;

var documento = '';
var carpeta = 'content';
var camino = '';
var DOC = [
["monterrey_clus ter.htm", "monterrey_cond .htm"],
["v_mexico_clust er.htm", "v_mexico_cond. htm"],
["leon_cluster.h tm", "leon_cond. htm"],
["merida_cluster .htm", "merida_cond.ht m"],
["culiacan_clust er.htm", "culiacan_cond. htm"],
["tijuana_cluste r.htm", "tijuana_cond.h tm"],
["puebla_cluster .htm", "puebla_cond.ht m"],
["nvo_laredo_clu ster.htm", "nvo_laredo_con d.htm"]
];

documento = DOC[+a.plaza.value][+a.tipo.value];

camino = (carpeta + '/' + documento + '#' + pregunta);

};
</script>
<noscript>
<p>Su navegador no soporta JavaScript&reg; </p>
</noscript>
</head>
<body>
<h1 class="toctitle ">Plaza</h1>

<!-- Inicia el Formulario -->
<form name="formulari o" action="" method="post" enctype="text/plain"
target="mainfra me">
<table width="200" border="0">
<tr>
<td>Plaza</td>

<!-- Se selecciona Plaza -->
<td><select name="plaza" id="plaza">
<option value=0>Monterr ey</option>
<option value=1>Valle de México</option>
<option value=2>León</option>
<option value=3>Mérida </option>
<option value=4>Culiacà ¡n</option>
<option value=5>Tijuana </option>
<option value=6>Puebla</option>
<option value=7>Nuevo Laredo</option>
</select></td>
</tr>
<tr>
<td>
</td>
<td>

<!-- Se selecciona Tipo -->
<input type="radio" name="tipo" id="tipo" value=0
checked>Clúste r<br>
<input type="radio" name="tipo" id="tipo" value=1>Condici ones
</td>
</tr>
<tr>
<td>Pregunta</td>

<!-- Se selecciona Pregunta -->
<td><select name="pregunta" id="select">
<option value=0>Plaza</option>
<!-- Filtros? -->
<option value=1>F1</option>
<option value=2>F2</option>
<!-- Preguntas -->
<option value=3>1</option>
<option value=4>2</option>
<option value=5>3</option>
<option value=6>4</option>
<option value=7>5</option>
<option value=8>6</option>
<option value=9>7</option>
<option value=10>8</option>
<option value=11>9</option>
<option value=12>10</option>
<option value=13>11</option>
<option value=14>12</option>
<option value=15>13</option>
<option value=16>14</option>
<option value=17>15</option>
<option value=18>16</option>
<option value=19>17</option>
<option value=20>18</option>
<option value=21>19</option>
<option value=22>20</option>
<option value=23>21</option>
<option value=24>22</option>
<option value=25>23</option>
<option value=26>24</option>
<option value=27>25</option>
<option value=28>26</option>
<option value=29>27</option>
<option value=30>28</option>
<option value=31>29</option>
<option value=32>30</option>
<option value=33>31</option>
<option value=34>32</option>
<option value=35>33</option>
<option value=36>34</option>
<option value=37>35</option>
<option value=38>36</option>
<option value=39>37</option>
<option value=40>38</option>
<option value=41>39</option>
<option value=42>40</option>
<option value=43>41</option>
<option value=44>42</option>
<option value=45>43</option>
<option value=46>44</option>
<option value=47>45</option>
<option value=48>46</option>
<option value=49>47</option>
<option value=50>48</option>
<option value=51>49</option>
<option value=52>50</option>
<option value=53>51</option>
<option value=54>52</option>
<option value=55>53</option>
<option value=56>54</option>
<option value=57>55</option>
<option value=58>56</option>
<option value=59>57</option>
<option value=60>58</option>
<option value=61>59</option>
<option value=62>60</option>
<option value=63>61</option>
<option value=64>62</option>
<option value=65>63</option>
<option value=66>64</option>
<option value=67>65</option>
<option value=68>66</option>
<option value=69>67</option>
<option value=70>68</option>
<option value=71>69</option>
<option value=72>70</option>
<option value=73>71</option>
<option value=74>72</option>
<option value=75>73</option>
<option value=76>74</option>
<option value=77>75</option>
<option value=78>76</option>
<option value=79>77</option>
<option value=80>78</option>
<option value=81>79</option>
<option value=82>80</option>
<option value=83>81</option>
<option value=84>82</option>
<option value=85>83</option>
<option value=86>84</option>
<option value=87>85</option>
<option value=88>86</option>
<option value=89>87</option>
<option value=90>88</option>
<option value=91>89</option>
</select></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>

<!-- Se envian valores al JavaScript -->
<td><input name="submit" type="submit" OnClick="proces o()"
value="Procesar "></td>
</tr>
</table>
</form>
<p>&nbsp;</p>
<p> <br>
<br>
</p>
</body>
</html>
# ---

Aug 2 '05 #4
Hi, Guy!

With your contribution the program responses good!

Only exists a couple of things:

1. The script display an alert box message and say that the document
"undefined" is not exists.

2. The script at end, launch the same page of origin (tocframe2.htm) to
mainframe.

Thanks in advance for any suggestion.

Aug 2 '05 #5

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

Similar topics

7
2299
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site. The only reason I know that is happening is because I keep track of the pages executed by the user to see how they have traversed the site. Has...
0
6466
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the report are based on the same View addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides in a SQL Server 2000 database. There are...
4
4032
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a form with multiple pages on it. There is one text field on the third page of the form that I need the user to complete before leaving the form or moving to the next record. So, in the BeforeUpdate event of the form itself I have the following code:
3
2661
by: dixie | last post by:
I have an Access 2000 form which has been running OK for a long time. Lately, it is playing up and doing things like causing Access to close suddenly when the form is opened or when saving the form in design view after a change. Today, I got the following message from the form when using a combo box. "The expression After Update you...
9
2810
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am facing. Please please help me to solve this as soon as possible. So here we go ... I am not able to take the screen shot of the windows form...
7
2638
by: Frank Maxey | last post by:
I am fairly new to VB.Net and am having a curious problem. I have an entry dialog form called from a main form. The calling form needs to check the DialogResult field for an OK response. In my button service in the dialog form, I have: Private Sub btnSave_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles...
7
1767
by: Trickynick1001 | last post by:
Hi, a newbie here. I don't have a real firm grasp on the idea of Javascript, as I'm used to programming in Qbasic and C. I'm not used to OOP. Anyway, I really don't have any idea what the problem is with this code, it just simply won't work properly. Some of the functions aren't done, but the main one gives me a Not a Number message in the...
9
9676
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
7
10244
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still lack some JavaScript solid knowdlege) The problem is that when I try to send a form's content with Ajax (I'm using the prototype library), for some...
1
1346
by: swathichavalla | last post by:
Problem description: Clients working with an apple computer with the safari browser are experiencing problems with brokerage orders. When the client wants to enter a stock order, the order entry screen displays 31-12-2005 as date. When the client presses the OK button, it states that the entered date is wrong. When the client changes the date...
0
7911
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...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8215
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...
0
6610
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...
0
5390
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...
0
3836
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...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.