www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Can't add value from form to the script

  1. #1
    Join Date
    Dec 2010
    Posts
    2

    resolved [RESOLVED] Can't add value from form to the script

    Hi everybody,

    I am developing a website for a customer who used to be able to trace the parcels through using javascript. After a while the courier changed their routines, and this got out of function. Now courier has provided with new url, but still the code is not working. I hope someone can help me with this.

    code is pasted below:

    <form name="nettsporform" method="post" onSubmit="return submitNettsporForm(\'nettsporform\')">
    <table width="750">
    <tr>
    <td valign="top" class="main" colspan="2">Bruk skjemaet under for hente frem sporingsinformasjon om sendingen din. Siden vil pne et eget vindu.</td></tr>
    <tr>
    <tr>
    <td valign="top" class="main" colspan="2">&nbsp;</td></tr>
    <tr>
    <td valign="top" class="main" align="right">Sending/kollinummer:<input type=\"text\" name=\"q\" id=\"value\" size=\"20\" maxlength=\"24\"></td>
    <script language="javascript">
    function submitNettsporForm(nettsporform) { window.open("http://sporing.posten.no/sporing.html?q="+document.nettsporform.q.value,"Nettspor","width=720,height=585,toolbar=no,menubar=y es,resizable=yes,status=yes,scrollbars=yes");
    }
    </script>
    <td valign="bottom" align="left" class="main">
    <a href="javascript:submitNettsporForm(\'nettsporform\')"><img hspace="5" src="includes/languages/norwegian/images/buttons/button_track.gif" border="0" alt="Hvor er sendingen?"></a></td>
    </tr>
    </form>
    </table>

    The problem is that I am not able to add value from the field name "q" to the url: http://sporing.posten.no/sporing.html?q= This is the field where customer puts in their parcelnummer.

    Thanks in advance for all help.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Incorrect nesting of form tags, invalid table and script in table also invalid
    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    
    <script type="text/javascript">
    function submitNettsporForm() {
     window.open("http://sporing.posten.no/sporing.html?q="+document.nettsporform.q.value,"Nettspor","width=720,height=585,toolbar=no,menubar=y es,resizable=yes,status=yes,scrollbars=yes");
    }
    </script>
    
    </head>
    <body>
    <form action="" name="nettsporform" method="post" onSubmit="return submitNettsporForm()">
    <table width="750">
    <tr>
    <td valign="top" class="main" colspan="2">Bruk skjemaet under for &#229; hente frem sporingsinformasjon om sendingen din. Siden vil &#229;pne et eget vindu.</td>
    </tr>
    <tr>
    <td valign="top" class="main" colspan="2">&nbsp;</td>
    </tr>
    <tr>
    <td valign="top" class="main" align="right">Sending/kollinummer:<input type="text" name="q" id="value" size="20" maxlength="24"></td>
    <td valign="bottom" align="left" class="main">
    <a href="#" onclick="submitNettsporForm(); return false;"><img hspace="5" src="includes/languages/norwegian/images/buttons/button_track.gif" border="0" alt="Hvor er sendingen?"></a></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Dec 2010
    Posts
    2
    Thanks for the help, works like a charm

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles