General discussion

Locked

HTML code...

By cuban_titanic ·
I need the html code necessary to have in a web page two field asking for for two differents strings. Then looking for and showing a txt file where the name is the sum of those two strings asked before. In case that the txt file does not exist I would need to notify that the file does not exist.

Thanks,

Frank J. Garcia

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

HTML code...

by kevin.riggs In reply to HTML code...

Frank,

I'll take a shot at what I think you want.

<form onSubmit="addMe()>
<input type="hidden" name="realFileName">
<table>
<tr>
<td>First String:</td>
<td>Second String:</td>
</tr>
<tr>
<td><input type="text" name="str1"></td>
<td><input type="text" name="str2"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit">
</tr>
</table>
</form>

<script language="javascript">
function addMe()
{
if(document.forms[0].str1!="")
{
if(document.forms[0].str2!="")
{
document.forms[0].realFileName.value = document.forms[0].str1.value + document.forms[0].str2.value;
return true;
}
return false;
}
return false;
}
</script>

Thisshould allow you to send the complete string to the cgi engine or scripted page.

Collapse -

HTML code...

by cuban_titanic In reply to HTML code...

I tested this code and it does not work. Remember than the end of this is to open a txt file with the name given in those two string. In this case I'm not sure if the value passed by document.forms[0].str1 and str2 has cut the extra blank space thatcan be at the end of the string.
Anyway, thank you...

Collapse -

HTML code...

by Zlatin Zlatev In reply to HTML code...

Well, in my humble opinion, if the file you want to search for is on the web server, this CANNOT be done with native HTML code (with ECMAScript/VBScript either).
If ASP, JSP, CGI, PHP, ISAPI or some other is available for your web server, this can be done with it. Need more info in order to help you.
Regards,
The BIG RED FOX

Collapse -

HTML code...

by cuban_titanic In reply to HTML code...

Poster rated this answer

Collapse -

HTML code...

by cuban_titanic In reply to HTML code...

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums