Willkommen |
|
myGully |
|
Links |
|
Forum |
|
|
|
 |
04.07.10, 16:51
|
#1
|
mygully lover
Registriert seit: Jan 2010
Ort: Mygully Platzt 1.
Beiträge: 117
Bedankt: 277
|
Html / javas***** Frage mit Formular
hi Leute,
ich habe ein Frage.
NUn ich habe ein Formular, in dem steht am Anfang (wenn man die Seite läft immer ein http:// )
nach dem http:// kann man dann seine Internetaddresse angeben.
Wenn man dann aber eine Seite eingetragen hat ( wird die Seite nicht neu geladen) und das http:// ist weg.
Könnte mir jemand helfen, und zwar so , dass das http:// nach dem eintragen einer Seite immer da bleibt!
Hier ist das http:// noch da!
Jetzt gebe ich die Addresse zu Ende ein!
Jetzt Trage ich die Seite ein. UNd das http:// ist weg
Ich möchte es aber immer dahaben
Brauche dringend HILFE!
|
|
|
04.07.10, 19:04
|
#2
|
Free to play
Registriert seit: Mar 2010
Beiträge: 101
Bedankt: 94
|
Mit S***** wäre es einfacher.
Anscheinend löscht du den Eintrag der Textbox nachdem auf Senden geklickt wurde.
Nach dem Löschen einfach wieder ein 'http:' reinsetzen (bzw gar nicht löschen und gleich reinsetzen)
|
|
|
04.07.10, 21:34
|
#3
|
mygully lover
Registriert seit: Jan 2010
Ort: Mygully Platzt 1.
Beiträge: 117
Bedankt: 277
|
ich poste den S***** morgen
|
|
|
05.07.10, 18:37
|
#4
|
mygully lover
Registriert seit: Jan 2010
Ort: Mygully Platzt 1.
Beiträge: 117
Bedankt: 277
|
so der HTml Code:
Zitat:
<div id="sitesbox">
<form id="addTask">
<div id="title">Seite eintragen</div>
<input type="text" id="newTask" value="http://" />
<input type="submit" value="Seite eintragen" />
</form>
<div id="listArea">
<div id="title">Deine Seiten</div>
<ol id="todo"></ol>
</div>
</div>
|
und hier der Javas***** Code:
Zitat:
window.addEvent('domready', function() {
//This is the function that will run every time a new item is added or the
//list is sorted.
var showNewOrder = function() {
//This function means we get serialize() to tell us the text of each
//element, instead of its ID, which is the default return.
var serializeFunction = function(el) { return el.get('text'); };
//We pass our custom function to serialize();
var orderTxt = sort.serialize(serializeFunction);
//And then we add that text to our page so everyone can see it.
$('data').set('text', orderTxt.join(' '));
};
//This code initalizes the sortable list.
var sort = new Sortables('.todo', {
handle: '.drag-handle',
//This will constrain the list items to the list.
constrain: true,
//We'll get to see a nice cloned element when we drag.
clone: true,
//This function will happen when the user 'drops' an item in a new place.
onComplete: showNewOrder
});
//This is the code that makes the text input add list items to the <ul>,
//which we then make sortable.
var i = 1;
$('addTask').addEvent('submit', function(e) {
e.stop();
//Get the value of the text input.
var val = $('newTask').get('value');
//The code here will execute if the input is empty.
if (!val) {
$('newTask').highlight('#f00').focus();
return; //Return will skip the rest of the code in the function.
}
//Create a new <li> to hold all our content.
var li = new Element('li', {id: 'item-'+i, text:val});
//This handle element will serve as the point where the user 'picks up'
//the draggable element.
var handle = new Element('div', {id:'handle-'+i, 'class':'drag-handle'});
handle.inject(li, 'top');
//Set the value of the form to '', since we've added its value to the <li>.
$('newTask').set('value', '');
//Add the <li> to our list.
$('todo').adopt(li);
//Do a fancy effect on the <li>.
li.highlight();
//We have to add the list item to our Sortable object so it's sortable.
sort.addItems(li);
//We put the new order inside of the data div.
showNewOrder();
i++;
});
});
|
|
|
|
05.07.10, 19:13
|
#5
|
Mitglied
Registriert seit: Aug 2009
Ort: void* (*wtf[])(void **);
Beiträge: 453
Bedankt: 137
|
Code:
//Set the value of the form to '', since we've added its value to the <li>.
$('newTask').set('value', '');
dann probier mal stattdessen ein:
Code:
$('newTask').set('value', 'http://am-besten-lerne-ich-mal-javascipt-und-jquery.de');
__________________
entropie erfordert keine wartung
|
|
|
06.07.10, 16:59
|
#6
|
mygully lover
Registriert seit: Jan 2010
Ort: Mygully Platzt 1.
Beiträge: 117
Bedankt: 277
|
Danke
|
|
|
Forumregeln
|
Du kannst keine neue Themen eröffnen
Du kannst keine Antworten verfassen
Du kannst keine Anhänge posten
Du kannst nicht deine Beiträge editieren
HTML-Code ist Aus.
|
|
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:26 Uhr.
().
|