|
|
I'm hoping someone could help me out. I'm very new to javascript and was able to create a jump box and a url convert script (see below). Both seem to work fine seperately, but when I attempt to use them both on the same page, the second script doens't want to work. I'm guessing this has to do with using location.href twice on the same page, but don't know enough about javascript to be able to make them both work. Any help, ideas and/or solutions would be much appreciated.
<code>
<form action="" name="jump1" id="jump1"><select name="myjumpbox" onchange="location.href=jump1.myjumpbox.options[selectedIndex].value" class="c1">
<option selected="selected">Select Search Type...</option>
<option value="http://www.bing.com">Google </option>
<option value="http://www.google.com">Bing </option>
<option value="http://www.yahoo.com">Yahoo </option>
</select></form>
<form name="changeurl" action="" method="get" onsubmit="location.href=converturl();return false">
<input type="hidden" id="f0ve" name="fullurl" value="jobs apply submit" />
<label><input type="text" size="28" id="f0va" name="url" value="" /></label></td>
<label><select name="city">
<option value="Dallas" selected="selected">Dallas</option>
<option value="">Nationwide</option>
<option value="Atlanta">Atlanta</option>
<option value="Austin">Austin</option>
<option value="Boston">Boston</option>
<option value="Chicago">Chicago</option>
</select></label></td>
<td><input type="submit" name="searchbutton" value="Search" class="c4" /></td>
</tr>
</table>
<script type="text/javascript">
function converturl() {
frm = document.forms[0];
return "http://www.bing.com/search/?q=" +
frm.fullurl.value +
frm.url.value + '+' +
frm.city[frm.city.selectedIndex].value
}
</script>
</code>
|
|
|
|
|
First, learn how to format code when posting here (use the pre tag)
You don't need the form elements, they are useless in this case. Handle the click event of the submit button (it doesn't need to be a submit type either) and call the converturl method.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
My bad on the code formatting. I thought I read to encase code in the code tag.
About your suggestion to remove the form elements. If I remove the form tag and it's elements all I that is dispayed in my browser is text??? I'm sorry if this sounds like I don't know the basics, but like I said, I'm a true beginner with javascript.
|
|
|
|
|
The form element has nothing to do with display of html, neither does it have anything to do with javascript.
A form is used as a container for controls and to specify an action, or the url to submit the form to, and a method, such as get or post. In your case you are not using this and simply redirecting to another url.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
<form name="jump1" id="jump1" action="" method="get" onsubmit="location.href=converturl();return false">
<input type="hidden" name="fullurl" id="f0ve" value="jobs apply submit" />
<table>
<tr><td>
<select name="myjumpbox" class="c1">
<option selected="selected">Select Search Type...</option>
<option value="http://www.bing.com">Bing </option>
<option value="http://www.google.com">Google </option>
<option value="http://www.yahoo.com">Yahoo </option>
</select>
</td></tr>
<tr><td>
<input type="text" size="28" id="f0va" name="url" value="" /></td>
</td></tr>
<tr><td>
<select name="city">
<option value="Dallas" selected="selected">Dallas</option>
<option value="">Nationwide</option>
<option value="Atlanta">Atlanta</option>
<option value="Austin">Austin</option>
<option value="Boston">Boston</option>
<option value="Chicago">Chicago</option>
</select>
</td>
<td>
<input type="submit" name="searchbutton" value="Search" class="c4" />
</td></tr>
</table>
</form>
<script type="text/javascript">
function converturl() {
frm = document.forms[0];
return frm.myjumpbox[frm.myjumpbox.selectedIndex].value + "/search?q=" +
frm.fullurl.value +
frm.url.value + '+' +
frm.city[frm.city.selectedIndex].value + '+' +
frm.url.value;
}
</script>
|
|
|
|
|
|
Don't cross post.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
prabhakavala wrote: what is the best answer to tell if I asked for my experience in the last project.
Well, what is your experience?
MVP 2010 - are they mad?
|
|
|
|
|
In frontpage:
Is there a way to make text move up and down without writing code?
|
|
|
|
|
Yes. Pick up the monitor and move it up and down.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks for your reply. How to pick up the monitor and move it up and down?
|
|
|
|
|
|
It seems that you don't get my question.
I mean in frontpage,
If you write text like your name on a webpage in design view and want that text when previewed in internet explorer to move up and down. Then how to do this?
|
|
|
|
|
It seems you don't my responses. Your question was a joke, so you got jokes in response. You can't do it without writing code.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Drink. Alot of drink.
Always does it for me.
Actually it's so efective it makes the entire room move up and down. And sideways too if you get it right.... Morality is indistinguishable from social proscription
|
|
|
|
|
I am working on a page with some email validation (classic asp) and I have a regex checking email addresses:
^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w][^_]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$
This worked perfectly, it allows multiple periods in the domain name, hyphens, etc. I have one issue though, I need it to allow for single-character domains (like 3.com). I am not very skilled in regex.
______________________
Oh Hamburgers!
|
|
|
|
|
See this site http://regxlib.com/
here you can find as well as test your regular expression.
!- F - R - I - E - N - D - S -!
|
|
|
|
|
Hi all.
My question to all the people involved in web developments...I am a mid level developer with equal experience in native (unmanaged) and .NET (managed) development environment using Microsoft technologies. I have also worked on windows and web environments; my question however is web related. I am in a process of developing a web-application myself. I know that ASP.NET makes it very easy to develop a website and get it up and running within no time. At least I can get a crude version very soon. However, that is not what I am looking for...I have decided the following:
Web UI : HTML/XHTML/DHTML/XML (compliance), .htc, activeX (if needed), CSS
UI logic : wt, cppCMS, other web widgets, etc.
Scripting : Java script for client side scripting, AJAX, event handling, etc.
Business logic : C++ only. I have surveyed a number of libs. However, I just do not know which is good enough to serve my needs.
What I have decided for business logic is follows:
General Logic: Threading, Collections, Regular Expressions, etc.
Security : as in encryption, user authentication and authorization...? need suggestions...ACE,LOKI,Crypto++, etc...many are there...dunt know which to use.
Web Services : gSOAP and XML...or else?
Data Access Layer or ORM: there are lot of good ones...I have looked for some of them...LibDB on SF, Hiberlite by google, wt::dbo by witty and waiting for Boost::Rdb...any suggestions?
I do not really want to use direct ODBC API
Database: MYSQL and XML is what I tentatively have decided upon...
So please let me know, where do I need to look to gain more insight as far as development technologies are concerned. As far as design is concerned, I have some knowledge to start with. But I want to clear the technology clutter first. This is keeping in mind that I have to develop a web app purely out of interest for starters. My intentions are to understand the intricacies of design and algorithms involved in development and want to make it open source, cross platform and performant (C++).
I am ready to discuss further...just waiting on a few thoughts...
Regards,
Bhushan
|
|
|
|
|
Hi, i m developing a asp.net application (c# and sql server)to manage students marks, I want know to the best practices which I can use to save the various students marks with different subjects , also I want to know the best way to design the User Interface using .net tools by which one can easily enter the marks of students according to their serial number for each of their subjects .
I want some suggestion regarding stability of database and easy interface for the user to save the marks...
If some one has done projects like this then please tell me the links and others resources which I can use...
Thanks,
|
|
|
|
|
|
Hello and good morning.
I'm working with ADO.NEt data services and I built a service for SQL. In SQL it works fine but for Oracle I can not find the provider. I made some reserch and it seems I have to get providers for oracle but they are not free. Any one knows where I can find free Oracle providers to build a data services with ADO.NET?
Thanks.
Regards Jonatan.
|
|
|
|
|
I'm pretty sure these are available for free on the Oracle[^] website or, at least they used to be. You'll have to do a search in the site as I have not used them for a few years.
|
|
|
|
|
Hi, I am back again with clarification in ajax post.
I am having a WYSIWYG (TinyMCE) editor for a description field.
I am posting it using AJAX.
Assume that the data is "lorum ispum & <p>sample text<p>"
so it will be like
var udescription = "lorum ispum&sampletextandothertext";
xmlhttp.open("POST","ajax.php?description="+udescription",true);
Obviously this will get posted as usual form the client side.
But the server parses it as
Array (
[udescription] = [lorum ispum],
[sampletextandotherext] = ''
)
that is, any letters after an ambersand is consider as a key and it searches for the '=' sign to take the value next to it...
so if i send "ajax.php?name=joe&number=989898&description=sample&one&two"
it will be like
name = joe
number = 989898
description = sample
one =
two =
So what i think is doing a base64encode here and doing a base64decode in the server side.
I have base64encode function for javascript.
Will this solution holds good or am i m i s s i n g something.
Do people have an alternate or a suggestion. Please provide any kind of info so that we forum users will update it.
How does a browser send data to the server. hope it sets the mime type to base64 and the server would check it and decode it.
The post data would be 7 bit, 8bit and base64 and then multipart data seperated by boundaries.
so we have to set a different content type or use additional methods of XMLHTTPRequest???
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|