Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Klikanie w buttony
Kylu12
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 17.07.2011

Ostrzeżenie: (0%)
-----


Chciałbym wiedzieć jak zrobić skrypt aby z stanu:

Na coś takiego:


Tutaj wkleje źródło strony:
<script type="text/javascript">
var nameHttp;

function checkName()
{
if(document.getElementById("newcharname").value=="")
{
document.getElementById("name_check").innerHTML = '<b><font color="red">Please enter new character name.</font></b>';
return;
}
nameHttp=GetXmlHttpObject();
if (nameHttp==null)
{
return;
}
var newcharname = document.getElementById("newcharname").value;
var url="ajax/check_name.php?name=" + newcharname + "&uid="+Math.random();
nameHttp.onreadystatechange=NameStateChanged;
nameHttp.open("GET",url,true);
nameHttp.send(null);
}

function NameStateChanged()
{
if (nameHttp.readyState==4)
{
document.getElementById("name_check").innerHTML=nameHttp.responseText;
}
}
</script>Please choose a name, vocation and sex for your character. <br/>In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >Askara.pl Rules</a>, or your character might get deleted or name locked.<br/><br/><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="0" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" > <table class="Table3" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url(layouts/tcom/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url(layouts/tcom/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url(layouts/tcom/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url(layouts/tcom/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Create Character</div> <span class="CaptionVerticalRight" style="background-image:url(layouts/tcom/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url(layouts/tcom/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url(layouts/tcom/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url(layouts/tcom/images/content/box-frame-edge.gif);" /></span></div> </div><tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url(layouts/tcom/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url(layouts/tcom/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="" size="30" maxlength="29" ><BR><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td><input type="radio" name="newcharsex" value="1" >male<br/><input type="radio" name="newcharsex" value="0" >female<br/></td></tr></table></div></div></table></div><div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" ><tr><td><input type="radio" name="newcharvocation" value="1" >Sorcerer</td></tr><tr><td><input type="radio" name="newcharvocation" value="2" >Druid</td></tr><tr><td><input type="radio" name="newcharvocation" value="3" >Paladin</td></tr><tr><td><input type="radio" name="newcharvocation" value="4" >Knight</td></tr></table></table></td></tr></table></div></table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url(layouts/tcom/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(layouts/tcom/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="layouts/tcom/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url(layouts/tcom/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(layouts/tcom/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="layouts/tcom/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table> </div>

</div>

Z góry dziękuje
Go to the top of the page
+Quote Post
Fifi209
post
Post #2





Grupa: Zarejestrowani
Postów: 4 655
Pomógł: 556
Dołączył: 17.03.2009
Skąd: Katowice

Ostrzeżenie: (0%)
-----


Dodaj po prostu
checked="checked" tam gdzie mają być domyślnie zaznaczone i używaj BB-CODE

Swoją drogą to HTML i nie ma związku z JS.

Ten post edytował Fifi209 17.07.2011, 10:45:12


--------------------
Zainteresowania: C#, PHP, JS, SQL, AJAX, XML, C dla AVR
Chętnie pomogę, lecz zanim napiszesz: Wujek Google , Manual PHP
Go to the top of the page
+Quote Post
phpion
post
Post #3





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




Proszę dodać odpowiednie BBCode. W przeciwnym razie temat zostanie zamknięty.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 09:42