using a script in a form...

Questions about how to install and problems installing - please read the documentation first!
Post Reply
mads
Posts: 22
Joined: Wed Jun 04, 2008 11:47 pm
Location: Århus Denmark
Contact:

using a script in a form...

Post by mads » Mon Jun 23, 2008 11:59 pm

Hi,

I have an old script to make a very plain and simple login page.
The user is promted to input two things: username and password.
In the script this is used ad synonym for 'folder' and 'filename'.htm

I have tried to reuse the code in CMSimple, but...

The code I use is this (I have put it into a table):

Code: Select all

<table border="0" width="383">
	<tr>
		<td><form name="bruger" action="#" onsubmit="location.href = this.kodeord1.value + '/' + this.kodeord2.value + '.htm'; return false">

<p><b>Brugernavn</b></p></td>
		<td>
		<input size="25" name="kodeord1"></td>
	</tr>
	<tr>
		<td>

<p><b>Adgangskode</b></p></td>
		<td>
<input type="password" size="25" name="kodeord2"></td>
	</tr>
	<tr>
		<td colspan="2" align="center">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="2" align="center">
		<input type="submit" value="Luk mig ind" onclick="location.href = this.form.kodeord1.value + '/' + this.form.kodeord2.value + '.htm'; return false"></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr></form>
</table>
How can I use this code in Cmsimple?
Or this a better way around it?
It dont want to make memberspages
It's online here: http://www.worlddance.dk/index.php?SKAB ... _for_sidst

:-) Mads

ZiPs
Posts: 633
Joined: Thu May 22, 2008 6:17 pm
Location: Faxe, Denmark
Contact:

Re: using a script in a form...

Post by ZiPs » Tue Jun 24, 2008 9:20 am

Hi mads

There is a javascript error in your script, the reason is that you close your form the wrong place, you can not put a form of a <td> and close it in another <td> test with w3 validation and see

On worlddance page, you close your form long before your onsubmit it

The script is here and works well when it is put into cmsimple
http://www.hjemmesideskolen.dk/scripts/pscript.asp

There is a test here

/ZiPs
Preben Dahl | Webmaster cmsimple.dk | Projekt-og domæne ejer Gert Ebersbach

mads
Posts: 22
Joined: Wed Jun 04, 2008 11:47 pm
Location: Århus Denmark
Contact:

Re: using a script in a form...

Post by mads » Wed Jun 25, 2008 8:59 pm

Ouups again i'm wrong in my coding... :-(
(Showing that i'm not a programmer)

Thanks for your help, and the link!
Actually it helped getting my attension to the benefit of using the script in iframe (or maybe wrapper for cmsimple)
It helps keeping the pages 'secret' :-)

:-) Mads

ZiPs
Posts: 633
Joined: Thu May 22, 2008 6:17 pm
Location: Faxe, Denmark
Contact:

Re: using a script in a form...

Post by ZiPs » Thu Jun 26, 2008 9:32 am

Hi mads

Then we are in the same boat as I am not a programme but autodedakt :D
these small typing error in your code will sometimes come

You have made many great web pages and offers training course in CMSimple you are far ahead of me :)

I agree that wrapper will function fine with this script and keep your layout

Happy to help :D

/ZiPs
Preben Dahl | Webmaster cmsimple.dk | Projekt-og domæne ejer Gert Ebersbach

Post Reply