formularz poczatkujacy problem

D

dariusz.sawicki

Witam

Dopiero zaczynam z js i mam taki problem:
Waliduje pole peseljs i dla maska_p wszystko jest okej natomiast dla
maska_p1 jest problem i nie mgoe tego rozgryzc;/




Js:

dzien=Form.dzienjs.value;
miesiac=Form.miesiacjs.value;
rok=Form.rokjs.value;

maska_p=/^[840101]{6,6}[0-9]{5,5}$/; //wpisane na stale
¿eby sprawdzic czy bêdzie dzia³a³o i dziala
maska_p1='/^['+rok+dzien+miesiac+']{6,6}[0-9]{5,5}$/'; //tutaj chce
zrobic na podstawie wybranych warto¶ci w formularzu alert jest ten sam
co i dal maska_p ale nie dziala
if (Form.peseljs.value.match(maska_p1)==null){
alert(maska_p);
return false;
}

Html :

<form action="" method="" onsubmit="return validate(this)">

Data urodzenia><br>dzien<br>
<select name="dzien" size="1" id="dzienjs">
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
<option value="05">5</option>
<option value="06">6</option>
<option value="07">7</option>
<option value="08">8</option>
<option value="09">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>

miesiac
<select name="miesiac" size="1" id="miesiacjs">
<option value="01">styczeñ</option>
<option value="02">luty</option>
<option value="03">marzec</option>
<option value="04">kwiecieñ</option>
<option value="05">maj</option>
<option value="06">czerwiec</option>
<option value="07">lipec</option>
<option value="08">sierpieñ</option>
<option value="09">wrzesieñ</option>
<option value="10">pa¼dziernik</option>
<option value="11">listopad</option>
<option value="12">grudzieñ</option>

</select>

rok
<select name="rok" size="1" id="rokjs">
<option value="84">1984</option>
<option value="85">1985</option>
<option value="86">1986</option>
<option value="87">1987</option>
<option value="88">1988</option>
<option value="89">1989</option>
<option value="91">1991</option>
<option value="92">1992</option>
<option value="93">1993</option>
<option value="94">1994</option>
</select>
<br>
PESEL<input type="text" name="pesel" value="" size="" id="peseljs">


<input type="submit" value="Wy¶lij">
</form>

Pyt2:
Je¶li funcja zostaje przerwana i otrzymujemy komunkat alert czy mo¿na
zrobic aby dane które by³y wczesniej podane i nie zwracaly false przy
sprawdzaniu zostaly nie naruszone a kursor przeniosl siê po alercie do
miejsca pola gdzie wyst±pi³ pprobowalem z onfocus ale wszystko ginie.
Pozdrawiam
 
V

VK


Hi. One could get much quicker help in clj by using English to explain
the problem as there are here much more people fluent in English then
in ones in Polish: though there can definitely be such in this group
as well. You may also ask at pl.comp.lang.javascript
 
D

dariusz.sawicki

Hi. One could get much quicker help in clj by using English to explain
the problem as there are here much more people fluent in English then
in ones in Polish: though there can definitely be such in this group
as well. You may also ask at pl.comp.lang.javascript

It's my mistake.
I think that i send it on pl.comp.lang.javascript
soryy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top