Keresés

Új hozzászólás Aktív témák

  • Kaoru
    senior tag

    Uh sziasztok kéne egy kis help.
    Javascripttel ''csináltam'' egy mező ellenőrzőt, h ne kelljen majd phpval és mysql-lel utána ellenőrizgetni. De valahogy így nem akar működni a gomb. Valaki rá tudna nézni?

    <html>
    <head>
    <title>Registration form</title>
    <script language=''javascript''>
    function DoSubmit ()
    if (document.form.fname1.value == '''')
    {
    alert (''You need to fill the field named: Family name 1'');
    document.form.fname1.focus ();
    return '''';
    }

    if (document.form.name1.value == '''') {
    alert (''You need to fill the field named: First name 1'');
    document.form.name1.focus ();
    return '''';
    }

    if (document.form.fname2.value == '''') {
    alert (''You need to fill the field named: Family name 2'');
    document.form.fname2.focus ();
    return '''';
    }

    if (document.form.name2.value == '''') {
    alert (''You need to fill the field named: First name 2'');
    document.form.fname2.focus ();
    return '''';
    }

    if (document.form.email.value == '''') {
    alert (''You need to fill the field named: E-mail'');
    document.form.email.focus ();
    return '''';
    }

    if (document.form.country.value == '''') {
    alert (''You need to fill the field named: Country'');
    document.form.country.focus ();
    return '''';
    }

    if (document.form.name.value == '''') {
    alert (''You need to fill the field named: Contact name'');
    document.form.name.focus ();
    return '''';
    }

    if (document.form.address.value == '''') {
    alert (''You need to fill the field named: Address'');
    document.form.address.focus ();
    return '''';
    }

    document.form.submit ();
    }
    </script>
    </head>
    <body>
    <form action=''livereg.php'' method=''post''>
    <!-- this line opens the form, be sure to place the filename of the file that you will use to process the form in place of ''livereg.php'', post is the chosen method to forward the values to the script --!>
    <table width=''90%'' border=''0''>
    <!-- NEVEK --!>
    <!-- táncos pár első fele --!>
    <tr>
    <td>
    Participant 1's name:
    </td>
    </tr>
    <tr>
    <tr>
    <td width=''300''>Family name</td>
    <td width=''300'' > <input type=''text'' name=''fname1'' size=''32''> * </td>
    </tr>
    <tr>
    <td width=''300''>First name</td>
    <td width=''300'' > <input type=''text'' name=''name1'' size=''32''> * </td>
    </tr>
    <!-- táncos pár második fele --!>
    <tr>
    <td>
    Participant 2's name:
    </td>
    </tr>
    <tr>
    <td width=''300''>Family name</td>
    <!-- táncos pár második fele --!>
    <td width=''300'' > <input type=''text'' name=''fname2'' size=''32''> * </td>
    </tr>
    <tr>
    <td width=''300''>First name</td>
    <td width=''300'' > <input type=''text'' name=''name2'' size=''32''> * </td>
    </tr>
    <!-- NEVEK VÉGE --!>
    <!-- NEM VÁLASZTÓ --!>
    <tr>

    <td><input type=''radio'' name=''gender'' value=''male''> Male</td>
    <br>
    <td><input type=''radio'' name=''gender'' value=''female''> Female</td>

    </tr>
    <!-- NEM VÁLASZTÓ VÉGE --!>
    <!-- EMAIL --!>
    <tr>
    <td>Your Email:</td>
    <td><input type=''text'' name=''email'' size=''32''> *</td>
    </tr>
    <tr>
    <!-- EMAIL VÉGE --!>
    <!-- ORSZÁG --!>
    <tr>
    <td>Country:</td>
    <td><input type=''text'' name=''country'' size=''32''> *</td>
    </tr>
    <tr>
    <!-- ORSZÁG VÉGE --!>
    <!-- KATEGÓRIA --!>
    <tr>
    <td>Discipline</td>
    <td>

    <select name=''Discipline''>
    <option value=''WBC''>Women's Ballroom ''C'' Class
    <option value=''WBB''>Women's Ballroom ''B'' Class
    <option value=''WBA'' selected=''selected''>Women's Ballroom ''A'' Class
    <option value=''WLC''>Women's Latin ''C'' Class
    <option value=''WLB''>Women's Latin ''B'' Class
    <option value=''WLA''>Women's Latin ''A'' Class
    <option value=''MBC''>Men's Ballroom ''C'' Class
    <option value=''MBB''>Men's Ballroom ''B'' Class
    <option value=''MBA''>Men's Ballroom ''A'' Class
    <option value=''MLC''>Men's Latin ''C'' Class
    <option value=''MLB''>Men's Latin ''B'' Class
    <option value=''MLA''>Men's Latin ''A'' Class
    </select>
    </td>

    </tr>
    <!-- KATEGÓRIA VÉGE --!>
    <!-- SIGHTSEEING --!>
    <tr>
    <td>Would You like to participate on the sightseeing tour of Budapest (15 Euro/person):</td>
    <td>

    <select name=''Sightseeing''>
    <option value=''yes1''>Yes, 1 person (15 Euro)
    <option value=''yes2'' selected=''selected''>Yes, 2 person (30 Euro)
    <option value=''no''>No
    </td>

    </tr>
    <!-- SIGHTSEEING VÉGE --!>
    <!-- SIGHTDAY --!>
    <tr>
    <td>If yes, which day do You prefer:</td>
    <td>

    <select name=''Sightday''>
    <option value=''day1''>Friday 20 October
    <option value=''day2'' selected=''selected''>Sunday 22 October
    </td>

    </tr>
    <!-- SIGHTDAY VÉGE --!>
    <!-- HOSTING --!>
    <tr>
    <td>Would You like to apply for hosted housing:</td>
    <td>

    <select name=''Sightseeing''>
    <option value=''yes'' selected=''selected''>Yes
    <option value=''no''>No
    </td>

    </tr>
    <!-- HOSTING VÉGE --!>
    <!-- CONTACTINFO --!>
    <tr>
    <td>Contact information:</td>
    </tr>
    <td>Your Full Name:</td>
    <td><input type=''text'' name=''name'' size=''50''> *</td>
    </tr>
    <tr>
    <td>Address:</td>
    <td><input type=''text'' name=''address'' size=''50''> *</td>
    </tr>
    <tr>
    <td>Phone:</td>
    <td><input type=''text'' name=''phone'' size=''50''></td>
    </tr>
    <tr>
    <td><input type=''hidden'' name=''mode'' value=''submit''></td>
    <td><input type=''button'' onclick=''DoSubmit ()'' value=''Register''></td>
    </tr>
    <!-- CONTACTINFO VÉGE --!>
    </table>
    </form>
    </body>
    </html>


    Élőben: [link]

    Előre is köszönöm!

    uh észrevettem 1 dolgot, h hiányzik.
    Szóval a kód msot így néz ki,d e hiába még midngi nem müxik:

    <?php

    if ($mode == ''submit'')
    {
    exit;
    }
    ?>

    <html>
    <head>
    <title>Registration form</title>
    <script language=''javascript''>
    function DoSubmit ()
    if (document.form.fname1.value == '''')
    {
    alert (''You need to fill the field named: Family name 1'');
    document.form.fname1.focus ();
    return '''';
    }

    if (document.form.name1.value == '''') {
    alert (''You need to fill the field named: First name 1'');
    document.form.name1.focus ();
    return '''';
    }

    if (document.form.fname2.value == '''') {
    alert (''You need to fill the field named: Family name 2'');
    document.form.fname2.focus ();
    return '''';
    }

    if (document.form.name2.value == '''') {
    alert (''You need to fill the field named: First name 2'');
    document.form.fname2.focus ();
    return '''';
    }

    if (document.form.email.value == '''') {
    alert (''You need to fill the field named: E-mail'');
    document.form.email.focus ();
    return '''';
    }

    if (document.form.country.value == '''') {
    alert (''You need to fill the field named: Country'');
    document.form.country.focus ();
    return '''';
    }

    if (document.form.name.value == '''') {
    alert (''You need to fill the field named: Contact name'');
    document.form.name.focus ();
    return '''';
    }

    if (document.form.address.value == '''') {
    alert (''You need to fill the field named: Address'');
    document.form.address.focus ();
    return '''';
    }

    document.form.submit ();
    }
    </script>
    </head>
    <body>
    <form action=''livereg.php'' method=''post''>
    <!-- this line opens the form, be sure to place the filename of the file that you will use to process the form in place of ''livereg.php'', post is the chosen method to forward the values to the script --!>
    <table width=''90%'' border=''0''>
    <!-- NEVEK --!>
    <!-- táncos pár első fele --!>
    <tr>
    <td>
    Participant 1's name:
    </td>
    </tr>
    <tr>
    <tr>
    <td width=''300''>Family name</td>
    <td width=''300'' > <input type=''text'' name=''fname1'' size=''32''> * </td>
    </tr>
    <tr>
    <td width=''300''>First name</td>
    <td width=''300'' > <input type=''text'' name=''name1'' size=''32''> * </td>
    </tr>
    <!-- táncos pár második fele --!>
    <tr>
    <td>
    Participant 2's name:
    </td>
    </tr>
    <tr>
    <td width=''300''>Family name</td>
    <!-- táncos pár második fele --!>
    <td width=''300'' > <input type=''text'' name=''fname2'' size=''32''> * </td>
    </tr>
    <tr>
    <td width=''300''>First name</td>
    <td width=''300'' > <input type=''text'' name=''name2'' size=''32''> * </td>
    </tr>
    <!-- NEVEK VÉGE --!>
    <!-- NEM VÁLASZTÓ --!>
    <tr>

    <td><input type=''radio'' name=''gender'' value=''male''> Male</td>
    <br>
    <td><input type=''radio'' name=''gender'' value=''female''> Female</td>

    </tr>
    <!-- NEM VÁLASZTÓ VÉGE --!>
    <!-- EMAIL --!>
    <tr>
    <td>Your Email:</td>
    <td><input type=''text'' name=''email'' size=''32''> *</td>
    </tr>
    <tr>
    <!-- EMAIL VÉGE --!>
    <!-- ORSZÁG --!>
    <tr>
    <td>Country:</td>
    <td><input type=''text'' name=''country'' size=''32''> *</td>
    </tr>
    <tr>
    <!-- ORSZÁG VÉGE --!>
    <!-- KATEGÓRIA --!>
    <tr>
    <td>Discipline</td>
    <td>

    <select name=''Discipline''>
    <option value=''WBC''>Women's Ballroom ''C'' Class
    <option value=''WBB''>Women's Ballroom ''B'' Class
    <option value=''WBA'' selected=''selected''>Women's Ballroom ''A'' Class
    <option value=''WLC''>Women's Latin ''C'' Class
    <option value=''WLB''>Women's Latin ''B'' Class
    <option value=''WLA''>Women's Latin ''A'' Class
    <option value=''MBC''>Men's Ballroom ''C'' Class
    <option value=''MBB''>Men's Ballroom ''B'' Class
    <option value=''MBA''>Men's Ballroom ''A'' Class
    <option value=''MLC''>Men's Latin ''C'' Class
    <option value=''MLB''>Men's Latin ''B'' Class
    <option value=''MLA''>Men's Latin ''A'' Class
    </select>
    </td>

    </tr>
    <!-- KATEGÓRIA VÉGE --!>
    <!-- SIGHTSEEING --!>
    <tr>
    <td>Would You like to participate on the sightseeing tour of Budapest (15 Euro/person):</td>
    <td>

    <select name=''Sightseeing''>
    <option value=''yes1''>Yes, 1 person (15 Euro)
    <option value=''yes2'' selected=''selected''>Yes, 2 person (30 Euro)
    <option value=''no''>No
    </td>

    </tr>
    <!-- SIGHTSEEING VÉGE --!>
    <!-- SIGHTDAY --!>
    <tr>
    <td>If yes, which day do You prefer:</td>
    <td>

    <select name=''Sightday''>
    <option value=''day1''>Friday 20 October
    <option value=''day2'' selected=''selected''>Sunday 22 October
    <option value=''refuse''>No
    </td>

    </tr>
    <!-- SIGHTDAY VÉGE --!>
    <!-- HOSTING --!>
    <tr>
    <td>Would You like to apply for hosted housing:</td>
    <td>

    <select name=''Hosting''>
    <option value=''yes'' selected=''selected''>Yes
    <option value=''no''>No
    </td>

    </tr>
    <!-- HOSTING VÉGE --!>
    <!-- CONTACTINFO --!>
    <tr>
    <td>Contact information:</td>
    </tr>
    <td>Your Full Name:</td>
    <td><input type=''text'' name=''name'' size=''50''> *</td>
    </tr>
    <tr>
    <td>Address:</td>
    <td><input type=''text'' name=''address'' size=''50''> *</td>
    </tr>
    <tr>
    <td>Phone:</td>
    <td><input type=''text'' name=''phone'' size=''50''></td>
    </tr>
    <tr>
    <td><input type=''hidden'' name=''mode'' value=''submit''></td>
    <td><input type=''button'' onclick=''DoSubmit ()'' value=''Register''></td>
    </tr>
    <!-- CONTACTINFO VÉGE --!>
    </table>
    </form>
    </body>
    </html>

  • Kaoru
    senior tag

    Uh sziasztok kéne egy kis help.
    Javascripttel ''csináltam'' egy mező ellenőrzőt, h ne kelljen majd phpval és mysql-lel utána ellenőrizgetni. De valahogy így nem akar működni a gomb. Valaki rá tudna nézni?

    <html>
    <head>
    <title>Registration form</title>
    <script language=''javascript''>
    function DoSubmit ()
    if (document.form.fname1.value == '''')
    {
    alert (''You need to fill the field named: Family name 1'');
    document.form.fname1.focus ();
    return '''';
    }

    if (document.form.name1.value == '''') {
    alert (''You need to fill the field named: First name 1'');
    document.form.name1.focus ();
    return '''';
    }

    if (document.form.fname2.value == '''') {
    alert (''You need to fill the field named: Family name 2'');
    document.form.fname2.focus ();
    return '''';
    }

    if (document.form.name2.value == '''') {
    alert (''You need to fill the field named: First name 2'');
    document.form.fname2.focus ();
    return '''';
    }

    if (document.form.email.value == '''') {
    alert (''You need to fill the field named: E-mail'');
    document.form.email.focus ();
    return '''';
    }

    if (document.form.country.value == '''') {
    alert (''You need to fill the field named: Country'');
    document.form.country.focus ();
    return '''';
    }

    if (document.form.name.value == '''') {
    alert (''You need to fill the field named: Contact name'');
    document.form.name.focus ();
    return '''';
    }

    if (document.form.address.value == '''') {
    alert (''You need to fill the field named: Address'');
    document.form.address.focus ();
    return '''';
    }

    document.form.submit ();
    }
    </script>
    </head>
    <body>
    <form action=''livereg.php'' method=''post''>
    <!-- this line opens the form, be sure to place the filename of the file that you will use to process the form in place of ''livereg.php'', post is the chosen method to forward the values to the script --!>
    <table width=''90%'' border=''0''>
    <!-- NEVEK --!>
    <!-- táncos pár első fele --!>
    <tr>
    <td>
    Participant 1's name:
    </td>
    </tr>
    <tr>
    <tr>
    <td width=''300''>Family name</td>
    <td width=''300'' > <input type=''text'' name=''fname1'' size=''32''> * </td>
    </tr>
    <tr>
    <td width=''300''>First name</td>
    <td width=''300'' > <input type=''text'' name=''name1'' size=''32''> * </td>
    </tr>
    <!-- táncos pár második fele --!>
    <tr>
    <td>
    Participant 2's name:
    </td>
    </tr>
    <tr>
    <td width=''300''>Family name</td>
    <!-- táncos pár második fele --!>
    <td width=''300'' > <input type=''text'' name=''fname2'' size=''32''> * </td>
    </tr>
    <tr>
    <td width=''300''>First name</td>
    <td width=''300'' > <input type=''text'' name=''name2'' size=''32''> * </td>
    </tr>
    <!-- NEVEK VÉGE --!>
    <!-- NEM VÁLASZTÓ --!>
    <tr>

    <td><input type=''radio'' name=''gender'' value=''male''> Male</td>
    <br>
    <td><input type=''radio'' name=''gender'' value=''female''> Female</td>

    </tr>
    <!-- NEM VÁLASZTÓ VÉGE --!>
    <!-- EMAIL --!>
    <tr>
    <td>Your Email:</td>
    <td><input type=''text'' name=''email'' size=''32''> *</td>
    </tr>
    <tr>
    <!-- EMAIL VÉGE --!>
    <!-- ORSZÁG --!>
    <tr>
    <td>Country:</td>
    <td><input type=''text'' name=''country'' size=''32''> *</td>
    </tr>
    <tr>
    <!-- ORSZÁG VÉGE --!>
    <!-- KATEGÓRIA --!>
    <tr>
    <td>Discipline</td>
    <td>

    <select name=''Discipline''>
    <option value=''WBC''>Women's Ballroom ''C'' Class
    <option value=''WBB''>Women's Ballroom ''B'' Class
    <option value=''WBA'' selected=''selected''>Women's Ballroom ''A'' Class
    <option value=''WLC''>Women's Latin ''C'' Class
    <option value=''WLB''>Women's Latin ''B'' Class
    <option value=''WLA''>Women's Latin ''A'' Class
    <option value=''MBC''>Men's Ballroom ''C'' Class
    <option value=''MBB''>Men's Ballroom ''B'' Class
    <option value=''MBA''>Men's Ballroom ''A'' Class
    <option value=''MLC''>Men's Latin ''C'' Class
    <option value=''MLB''>Men's Latin ''B'' Class
    <option value=''MLA''>Men's Latin ''A'' Class
    </select>
    </td>

    </tr>
    <!-- KATEGÓRIA VÉGE --!>
    <!-- SIGHTSEEING --!>
    <tr>
    <td>Would You like to participate on the sightseeing tour of Budapest (15 Euro/person):</td>
    <td>

    <select name=''Sightseeing''>
    <option value=''yes1''>Yes, 1 person (15 Euro)
    <option value=''yes2'' selected=''selected''>Yes, 2 person (30 Euro)
    <option value=''no''>No
    </td>

    </tr>
    <!-- SIGHTSEEING VÉGE --!>
    <!-- SIGHTDAY --!>
    <tr>
    <td>If yes, which day do You prefer:</td>
    <td>

    <select name=''Sightday''>
    <option value=''day1''>Friday 20 October
    <option value=''day2'' selected=''selected''>Sunday 22 October
    </td>

    </tr>
    <!-- SIGHTDAY VÉGE --!>
    <!-- HOSTING --!>
    <tr>
    <td>Would You like to apply for hosted housing:</td>
    <td>

    <select name=''Sightseeing''>
    <option value=''yes'' selected=''selected''>Yes
    <option value=''no''>No
    </td>

    </tr>
    <!-- HOSTING VÉGE --!>
    <!-- CONTACTINFO --!>
    <tr>
    <td>Contact information:</td>
    </tr>
    <td>Your Full Name:</td>
    <td><input type=''text'' name=''name'' size=''50''> *</td>
    </tr>
    <tr>
    <td>Address:</td>
    <td><input type=''text'' name=''address'' size=''50''> *</td>
    </tr>
    <tr>
    <td>Phone:</td>
    <td><input type=''text'' name=''phone'' size=''50''></td>
    </tr>
    <tr>
    <td><input type=''hidden'' name=''mode'' value=''submit''></td>
    <td><input type=''button'' onclick=''DoSubmit ()'' value=''Register''></td>
    </tr>
    <!-- CONTACTINFO VÉGE --!>
    </table>
    </form>
    </body>
    </html>


    Élőben: [link]

    Előre is köszönöm!

  • Kaoru
    senior tag

    kicsit off, de elkezdtem tanulni suliban javascriptet, gondoltam a jegyzeteket megosztom veletek is: [link]
    Ha hasznosnak találjátok, akkor majd a következő óra anyagát is felrakom. A zip egyébként tartalmaz 3 html fájlt (forrást kell nézni, abban benne van kommentekkel együtt a script) illetve egy txt minimális elmélettel.

    Üdv.

    [Szerkesztve]

    link elszúrva, ez a helyes

    [link]

  • Kaoru
    senior tag

    kicsit off, de elkezdtem tanulni suliban javascriptet, gondoltam a jegyzeteket megosztom veletek is: [link]
    Ha hasznosnak találjátok, akkor majd a következő óra anyagát is felrakom. A zip egyébként tartalmaz 3 html fájlt (forrást kell nézni, abban benne van kommentekkel együtt a script) illetve egy txt minimális elmélettel.

    Üdv.

    [Szerkesztve]

  • Kaoru
    senior tag

    Ha találsz valami megoldást, akkor azért írd már be, légyszi. Engem is érdekelne a technikai része, bár valószínűleg használni nem fogom .

    [Szerkesztve]

    bár a ctrl+c ctrl+v tiltására ekrestem, ezeket találtam:
    http://www.faqts.com/knowledge_base/view.phtml/aid/11861/fid/53 (mozillában nem müxött)
    aztán ez is ír érdekes dolgokat
    http://web.archive.org/web/20041130083748/http://www.vortex-webdesign.com/help/hidesource.htm

    Egy helyet tudok egyedül, ahol teljes a védelem: tectus honlapja. Igaz csak ie alol, de nem is engedi, h más böngészőval nézzük meg. Valahogy az active-x vezérlővel oldották meg.

  • Kaoru
    senior tag

    Esetleg még talán úgy, hogy képként kellene kitenni a szöveget... Más ötletem nincs.

    Köszönöm szépen azért, még én is nézelődök hátha találok valamit.

  • Kaoru
    senior tag

    Erre inkább azt a megoldást szokták választani, hogy PDF-be teszik az anyagot, és a PDF-ben le lehet tiltani a szöveg szelektálását, és ezt már nehezebb törni.

    az oldal blogrendszerben van, tehát ez egy kicsit bonyolítja a helyzetet.

  • Kaoru
    senior tag

    Van egy ilyen módszer rá, ez a programrész nem engedi kiszelektálni az oldalban szöveget:

    <body onselectstart=''return false''>

    Egyébként meg javascript kikapcs, és máris megy a másolás.

    [Szerkesztve]

    igen ezt próbáltam ki 2 perce. De a ctl+c és a ctrl+v-t még mindig engedélyezi.

  • Kaoru
    senior tag

    Mi ütött belétek? :F
    Először a statusbar, most meg a copy&paste?
    Ne csináljatok ilyeneket, csak a felhasználókat haragítjátok magatokra!
    Különben sem érnek semmit az ilyen próbálkozások :U

    igen utána olvastam, hogy igazándiból nincs rá egyszerű megoldás.

    Azért fontos, mert tényleg jogvédett cuccról lenne szó, és a szerző nem nagyon szeretné, ha össze-vissza másolgatnák. Persze aki nagyon akarja az úgy is megnézi a forráskódot.

  • Kaoru
    senior tag

    Sziasztok, lenne 1 kérdésem, s bár nem biztos úgy gondolom ez javascripttel lehet megoldani.

    Annyi lenne, hogy mind mozilla/explorer alatt, ha valaki kimásolni szeretne szöveget (jobbclickes copy-paste) akkor azt ne engedje (és mondjuk egy ablak ezt a tudtára is adhatná a böngésző egyednek)

    Segítségeteket előre is köszönöm.

Új hozzászólás Aktív témák